Use of constant instead of variable in VBA Solver

S

Skovorodin

Sometimes it is necessary to use a constant instead of variable in VB
Solver. Is there any way to solve the problem? It is described in th
file switch.zip with macros

+-------------------------------------------------------------------
|Filename: switch.zip
|Download: http://www.excelbanter.com/attachment.php?attachmentid=358
+-------------------------------------------------------------------
 
S

Skovorodin

Skovorodin;1601389 said:
Sometimes it is necessary to use a constant instead of variable in VB
Solver. Is there any way to solve the problem? It is described in th
file switch.zip with macros.

Let us assume that Cell "$G$19" encloses a variable.
One approach to convert the variable into constant is to use the sam
value (for example, 1)
SolverAdd CellRef:="$G$19", Relation:=3, FormulaText:="1"
SolverAdd CellRef:="$G$19", Relation:=1, FormulaText:="1

+-------------------------------------------------------------------
+-------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top