SpreadsheetGear 2010
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

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Copyright © 2003-2010 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.