R
robs3131
Hi,
I have a loop that executes Solver -- I have the following questions:
1 - It appears that once Solver is first set up to run, it stores the values
and constraints so that if they are not changed, it will keep those initial
values. Assuming this is correct and given that I am referencing cells on my
sheet that change in value with each instance of the loop, I'm thinking that
all I need to do is set up Solver once in my code for it's initial run and
then just have it execute each time it loops through. Does this sound right
to you? Below is my Solver code within the loop.
SolverOk SetCell:="$AF$1", MaxMinVal:=2, ValueOf:="0", _
ByChange:="payfclearbin"
SolverAdd CellRef:="payfclearbin", Relation:=5, FormulaText:="binary"
SolverAdd CellRef:="$AE$1", Relation:=2, FormulaText:=Range("AD1").Value
SolverSolve userfinish:=True
2 - Just in case I need to, if I wanted to delete all prior constraints
("Cellref"), is there a way to have all constraints deleted at once rather
than deleting each individual constraint one by one?
Thanks!
Robert
I have a loop that executes Solver -- I have the following questions:
1 - It appears that once Solver is first set up to run, it stores the values
and constraints so that if they are not changed, it will keep those initial
values. Assuming this is correct and given that I am referencing cells on my
sheet that change in value with each instance of the loop, I'm thinking that
all I need to do is set up Solver once in my code for it's initial run and
then just have it execute each time it loops through. Does this sound right
to you? Below is my Solver code within the loop.
SolverOk SetCell:="$AF$1", MaxMinVal:=2, ValueOf:="0", _
ByChange:="payfclearbin"
SolverAdd CellRef:="payfclearbin", Relation:=5, FormulaText:="binary"
SolverAdd CellRef:="$AE$1", Relation:=2, FormulaText:=Range("AD1").Value
SolverSolve userfinish:=True
2 - Just in case I need to, if I wanted to delete all prior constraints
("Cellref"), is there a way to have all constraints deleted at once rather
than deleting each individual constraint one by one?
Thanks!
Robert