Thanks in advance for any help,
I'm using Excel 2007 in Windows 7.
I'm trying to automate multiple Solver scenarios. I began by trying to automate just one. I proceeded to record my actions. The result was:
When I run this macro again, I get a dialog box at the end of it asking me to confirm whether or not to keep the solution.
My question is, can I use VBA to automatically choose the "Keep Solver Solution" radio button (already selected by default) and then click "OK"?
Thanks,
Sean
I'm using Excel 2007 in Windows 7.
I'm trying to automate multiple Solver scenarios. I began by trying to automate just one. I proceeded to record my actions. The result was:
Code:
Sub Macro5()
'
' Macro5 Macro
'
'
SolverOk SetCell:="$AA$46", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$AA$29,$AA$39:$AA$40"
SolverDelete CellRef:="$Z$29:$Z$40", Relation:=1, FormulaText:="1"
SolverAdd CellRef:="$AA$29:$AA$40", Relation:=1, FormulaText:="1"
SolverOk SetCell:="$AA$46", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$AA$29,$AA$39:$AA$40"
SolverDelete CellRef:="$Z$29:$Z$40", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$AA$29:$AA$40", Relation:=3, FormulaText:="0"
SolverOk SetCell:="$AA$46", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$AA$29,$AA$39:$AA$40"
SolverDelete CellRef:="$Z$41", Relation:=2, FormulaText:="1"
SolverAdd CellRef:="$AA$41", Relation:=2, FormulaText:="1"
SolverOk SetCell:="$AA$46", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$AA$29,$AA$39:$AA$40"
SolverSolve
End Sub
When I run this macro again, I get a dialog box at the end of it asking me to confirm whether or not to keep the solution.
My question is, can I use VBA to automatically choose the "Keep Solver Solution" radio button (already selected by default) and then click "OK"?
Thanks,
Sean