Hello:
I am trying to use the SOlverOK module ina loop ina macro and I am not able to reset the cosntraint set. Code I am using is below. PLEASE HELP!!
thanks
msuryexcel
****
For j = 2 To numdates - k1
rj = rk + j
ri = rj - 500
riold = ri - 1
Range(col3 & rj).Select
SolverOk SetCell:=col3 & rj, MaxMinVal:=2, ValueOf:="0", ByChange:= _
"$E$" & ri & ":$AA$" & ri
SolverDelete CellRef:="$AC$" & riold, Relation:=2, FormulaText:="1"
SolverAdd CellRef:="$AC$" & ri, Relation:=2, FormulaText:="1"
SolverOk SetCell:=col3 & rj, MaxMinVal:=2, ValueOf:="0", ByChange:= _
"$E$" & ri & ":$AA$" & ri
SolverDelete CellRef:="$E$" & riold & ":$AA$" & riold, Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$E$" & ri & ":$AA$" & ri, Relation:=3, FormulaText:="0"""
SolverOk SetCell:=col3 & rj, MaxMinVal:=2, ValueOf:="0", ByChange:= _
"$E$" & ri & ":$AA$" & ri
SolverSolve
Next j
****
Bookmarks