SolverDelete Function
Deletes an existing constraint. Equivalent to clicking Solver in the Data | Analysis group and then clicking Delete 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.
SolverDelete(CellRef, Relation, FormulaText)CellRef Required Variant. A reference to a cell or a range of cells that forms the left side of a constraint.
Relation Required Integer. The arithmetic relationship between the left and right sides of the constraint. If you choose 4 or 5, CellRefmust refer to adjustable (changing) cells, and FormulaTextshould not be specified.
| Relation | Arithmetic relationship |
|---|---|
| 1 | <= |
| 2 | = |
| 3 | >= |
| 4 | Cells referenced by CellRef must have final values that are integers. |
| 5 | Cells referenced by CellRef must have final values of either 0 (zero) or 1. |
Example
This example loads the previously calculated Solver model stored on Sheet1, deletes one of the constraints, and then solves the model again.
|