contents.gifprev1.gifnext1.gif


SolverOk

Equivalent to choosing Range Analyze Solver... and making entries and selections in the Solver Parameters dialog box. Specifies basic Solver options. The dialog box will not be displayed.

Syntax

SolverOk(SetCell, MaxMinVal, Valueof, ByChange)

SetCell corresponds to the Set Cell box in the Solver Parameters dialog box (the objective function in the optimization problem). SetCell must be a reference to a cell on the active worksheet. If you enter a cell, you must enter a value for MaxMinVal. If you do not enter a cell, you must include three zeroes (0, 0, 0) before the ByChanging value.

MaxMinVal corresponds to the options Max, Min and Value Of in the Solver Parameters dialog box. Use this option only if you entered a reference for SetCell.

MaxMinVal Option specified
1 Maximize
2 Minimize
3 Value Of

ValueOf is the number that becomes the target for the cell in the Set Cell box if MaxMinVal is 3. ValueOf is ignored if the cell is being maximized or minimized.

ByChanging indicates the changing cells (decision variables), as entered in the By Changing Cells box. ByChanging must be a cell reference (usually a cell range or multiple reference) on the active worksheet. You can add more changing cell references using Form 2 of the SolverAdd function.