
Step 10: Use the same SolverAdd function. SolverAdd CellRef:=Range("B2"), Relation:=3, Formulatext:=8 Step 9: FormulaText should contain the value which you wanted to set for the Unit Cost. SolverAdd CellRef:=Range("B2"), Relation:=3, Since we wanted the Unit Cost to be more than 8 (>=8). Step 8: Second Argument for Relation should have a value 3. Therefore, we will add B2 as the first argument under SolverAdd. For us, we need to change the Unit Cost for the product to get the equation solved. Step 7: The First argument for SolverAdd is CellRef. Step 6: Now, we will add the constraints under for the Solver using SolverAdd function. Rest other arguments are optional and it is ok if you don’t put those in this function. In this case, we will be using Item to be Sold as well as Unit Cost values (B1 and B2 respectively) as a reference.
:max_bytes(150000):strip_icc()/005-what-is-excel-solver-eeb895192bf2403d9fa54f42b21bfc7e.jpg)
Step 5: For B圜hange, we need to provide the range of cells whose values should be changed to solve this optimization problem. Therefore, set the MaxMinVal as 3 and ValueOf as 12000 inside SolverOK.

Step 4: We are expecting a specific profit value (12000). Step 3: Since we need to set the profit value, use B8 as a SetCell argument under the SolverOK function. Step 2: Use SolverOK so that we can set the objective cells associated with the given problem. Let’s do this in VBA Solver. For this, follow the below steps: We wanted to get a minimum profit of 12000 by changing the values of Item to be Sold (which should be an integer) and Unit Price (which should be between 8 to 12).
EXCEL SOLVER FUNCTION MULTIPLE TIMES DOWNLOAD
You can download this VBA Solver Excel Template here – VBA Solver Excel Template
EXCEL SOLVER FUNCTION MULTIPLE TIMES HOW TO
We will learn how to use Solver using the VBA code in Excel.


This is the first step that you need to enable solver so that you can use it under VBA.
