Attempts to find the value for one cell that produces the desired formula result in another cell.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As FpSpread
Dim variableSheet As Integer
Dim variableRow As Integer
Dim variableColumn As Integer
Dim formulaSheet As Integer
Dim formulaRow As Integer
Dim formulaColumn As Integer
Dim desiredResult As Double
Dim value As Boolean
value = instance.GoalSeek(variableSheet, variableRow, variableColumn, formulaSheet, formulaRow, formulaColumn, desiredResult) |
Parameters
- variableSheet
- Sheet index of cell that contains value to adjust
- variableRow
- Row index of cell that contains value to adjust
- variableColumn
- Column index of cell that contains value to adjust
- formulaSheet
- Sheet index of cell that contains the formula
- formulaRow
- Row index of cell that contains the formula
- formulaColumn
- Column index of cell that contains the formula
- desiredResult
- Formula result you wish to achieve
Return Value
Boolean:
true if successful;
false otherwise
Example
This example uses the GoalSeek method.
C# | Copy Code |
---|
fpSpread1.Sheets[0].Cells[1, 1].Formula = "C1+D1";
fpSpread1.Sheets[0].Cells[0, 3].Value = 2;
fpSpread1.GoalSeek(0, 0, 2, 0, 1, 1, 32); |
Visual Basic | Copy Code |
---|
FpSpread1.Sheets(0).Cells(1, 1).Formula = "C1+D1"
FpSpread1.Sheets(0).Cells(0, 3).Value = 2
FpSpread1.GoalSeek(0, 0, 2, 0, 1, 1, 32) |
Requirements
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8
See Also