C
CBB
I execute the following code and on one worksheet within the workbook it adds
the contraints fine. On the other worksheets it does not add the constraints
at all unless the formula text is not set to 1. Has anyone run into this
same issue? Any help would be greatly appreciated.
Thanks
Function calculate()
SolverReset
SolverAdd CellRef:="$AW$10", Relation:=2, FormulaText:="1"
SolverAdd CellRef:="$AW$11", Relation:=2, FormulaText:="1"
SolverOk SetCell:="$AW$31", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$AB$10:$AB$24,$AC$11:$AC$24,$AD$12:$AD$24,$AE$13:$AE$24,$AF$14:$AF$24,$AG$15:$AG$24,$AH$16:$AH$24,$AI$17:$AI$24,$AJ$18:$AJ$24,$AK$19:$AK$24,$AL$20:$AL$24,$AM$21:$AM$24,$AN$22:$AN$24,$AO$23:$AO$24,$AP$24"
SolverOptions MaxTime:=1000, Iterations:=1000, Precision:=0.0000001, _
AssumeLinear:=False, StepThru:=False, Estimates:=1, Derivatives:=1, _
SearchOption:=1, IntTolerance:=5, Scaling:=False,
Convergence:=0.0000001, _
AssumeNonNeg:=False
SolverSolve userFinish:=True
End Function
the contraints fine. On the other worksheets it does not add the constraints
at all unless the formula text is not set to 1. Has anyone run into this
same issue? Any help would be greatly appreciated.
Thanks
Function calculate()
SolverReset
SolverAdd CellRef:="$AW$10", Relation:=2, FormulaText:="1"
SolverAdd CellRef:="$AW$11", Relation:=2, FormulaText:="1"
SolverOk SetCell:="$AW$31", MaxMinVal:=3, ValueOf:="0", ByChange:= _
"$AB$10:$AB$24,$AC$11:$AC$24,$AD$12:$AD$24,$AE$13:$AE$24,$AF$14:$AF$24,$AG$15:$AG$24,$AH$16:$AH$24,$AI$17:$AI$24,$AJ$18:$AJ$24,$AK$19:$AK$24,$AL$20:$AL$24,$AM$21:$AM$24,$AN$22:$AN$24,$AO$23:$AO$24,$AP$24"
SolverOptions MaxTime:=1000, Iterations:=1000, Precision:=0.0000001, _
AssumeLinear:=False, StepThru:=False, Estimates:=1, Derivatives:=1, _
SearchOption:=1, IntTolerance:=5, Scaling:=False,
Convergence:=0.0000001, _
AssumeNonNeg:=False
SolverSolve userFinish:=True
End Function