SpreadsheetGear
GoalSeek Method
See Also  Send Feedback
SpreadsheetGear Namespace > IRange Interface : GoalSeek Method

goal
Specifies the desired goal from the calculated result of the formula in the cell represented by this IRange.
changingCell
Specifies the cell to change.
Attempts to achieve the specified goal, from the calculated result of the formula in the cell represented by this IRange, by modifying the specified changingCell using a simple iterative linear search.

Syntax

Visual Basic (Declaration) 
Function GoalSeek( _
   ByVal goal As Double, _
   ByVal changingCell As IRange _
) As Boolean
C# 
bool GoalSeek( 
   double goal,
   IRange changingCell
)

Parameters

goal
Specifies the desired goal from the calculated result of the formula in the cell represented by this IRange.
changingCell
Specifies the cell to change.

Return Value

true if the desired goal is achieved or false if the goal is not achieved.

Remarks

This GoalSeek method uses a simple iterative linear search for a value which, when placed in the cell specified by changingCell, yields a calculated result very close to the specified goal from the formula in the cell represented by this IRange.

The cell represented by this IRange should contain a formula which is directly or indirectly dependant on the cell specified by changingCell.

The cell specified by changingCell will contain the value used to achieve the desired goal if this method is successful.

Requirements

Platforms: Windows 2000, Windows XP, Windows Vista, Windows Server 2003 and Windows Server 2008. SpreadsheetGear 2009 requires the Microsoft .NET Framework 2.0 and supports .NET 3.0 and .NET 3.5.

See Also

Copyright © 2003-2009 SpreadsheetGear LLC. All Rights Reserved.Help Powered by Innovasys   
SpreadsheetGear is a registered trademark of SpreadsheetGear LLC.
Microsoft, Microsoft Excel and Visual Studio are trademarks or registered trademarks of Microsoft Corporation.