This documentation is archived and is not being maintained.

SolverChange Function

Office 2007

Changes an existing constraint. Equivalent to clicking Solver in the Data | Analysis group and then clicking Change in the Solver Parameters dialog box.

Before you use this function, you must establish a reference to the Solver add-in. In the Visual Basic Editor, with a module active, click References on the Tools menu, and then select the Solver.xlam check box under Available References. If Solver.xlam does not appear under Available References, click Browse and open Solver.xlam in the \office12\library\Solver subfolder.

SolverChange(CellRef, Relation, FormulaText)

RelationArithmetic relationship
4Cells referenced by CellRef must have final values that are integers.
5Cells referenced by CellRef must have final values of either 0 (zero) or 1.


If CellRef and Relation do not match an existing constraint, you must use the SolverDelete and SolverAdd functions to change the constraint.


This example loads the previously calculated Solver model stored on Sheet1, changes one of the constraints, and then solves the model again.

SolverLoad loadArea:=Range("A33:A38")
SolverChange cellRef:=Range("F4:F6"), _
    relation:=1, _
SolverSolve userFinish:=False