XLL+ Class Library (7.0)

CXlMacros::GoalSeek

Equivalent to choosing the Goal Seek command from the Tools menu

static int GoalSeek(
   const CXlOper& target_cell,
   const CXlOper& target_value,
   const CXlOper& variable_cell
);

Parameters

target_cell

Target_cell corresponds to the Set Cell box in the Goal Seek dialog box and is a reference to the cell containing the formula.

target_value

Target_value corresponds to the To Value box in the Goal Seek dialog box and is the value you want the formula in target_cell to return.

variable_cell

Variable_cell corresponds to the By Changing Cell box in the Goal Seek dialog box and is the single cell that you want Microsoft Excel to change so that the formula in target_cell returns target_value.

Return Value

Zero if the function has been called successfully; non-zero if the function could not be called. See Error codes for a list of return values.

Remarks

See the Microsoft Excel on-line Help for full details about this function.

Requirements

Header: xlfuncs.h

See Also

CXlMacros Class | CXlMacros Methods