Attempt to find value for one cell that produces the desired formula result in another cell.
Syntax
Parameters
- variableRow
- Row index of cell that contains value to adjust
- variableColumn
- Column index of cell that contains value to adjust
- formulaDataModel
- Data model of cell that contains formula
- formulaRow
- Row index of cell that contains formula
- formulaColumn
- Column index of cell that contains 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 |
---|
FarPoint.Win.Spread.Model.DefaultSheetDataModel dataModel = (FarPoint.Win.Spread.Model.DefaultSheetDataModel)fpSpread1.Sheets[0].Models.Data;
fpSpread1.Sheets[0].Cells[1, 1].Formula = "C1+D1";
fpSpread1.Sheets[0].Cells[0, 3].Value = 2;
dataModel.GoalSeek(0, 2, dataModel, 1, 1, 32); |
Visual Basic | Copy Code |
---|
Dim dataModel As New FarPoint.Win.Spread.Model.DefaultSheetDataModel(5, 5)
FpSpread1.ActiveSheet.Models.Data = dataModel
FpSpread1.Sheets(0).Cells(1, 1).Formula = "C1+D1"
FpSpread1.Sheets(0).Cells(0, 3).Value = 2
dataModel.GoalSeek(0, 2, dataModel, 1, 1, 32) |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also