Simple Macro help for Excel Solver
I have a simple macro that performs a Solver routine. For one of my variables (cell AF61), I have two constraints:
SolverAdd CellRef:="$AF$61", Relation:=1, FormulaText:="$ak$75"
SolverAdd CellRef:="$AF$61", Relation:=3, FormulaText:="$aj$75"
So this just ensures that AF61 stays between those two limits.
However, I want to specify the value of AF61 right before the solversolve command. I have it in my mind that the "starting value" is important? What I did was just add the following line:
AF61 = (AK75 + AJ75)/2
My goal is to make the "starting value" of AF 61 halfway between AK75 and AJ75 (the limits). That line doesn't fail, but I have no idea if it is the right way to specify a cell value in VBA! There are no Dim statements in the solver macro, so I assume the dimensioning has already been taken care of internally. Is there a way to specify the value of cell AF61 in the macro like this? Thanks a lot for any help.
|