Syntax

expression.GoalSeek(Goal, ChangingCell)

expression A variable that represents a Range object.

Parameters

Name Required/Optional Data Type Description
Goal Required Variant The value you want returned in this cell.
ChangingCell Required Range Specifies which cell should be changed to achieve the target value.

Return Value
Boolean

Example

This example assumes that Sheet1 has a cell named "Polynomial" that contains the formula =(X^3)+(3*X^2)+6 and another cell named "X" that's empty. The example finds a value for X so that Polynomial contains the value 15.

Visual Basic for Applications
Worksheets("Sheet1").Range("Polynomial").GoalSeek _ Goal:=15, _ ChangingCell:=Worksheets("Sheet1").Range("X")
Changing variables in an equation to arrive at a specific value? goal goal seek Goal Seek Method GoalSeek GoalSeek Method GoalSeek? Iterative solution for a formula? Method for solving a mathematical equation?