A
agentjoe90
Have a workbook that I want to create a macro use solver on multipl
sheets.
1st Sheet is a summary (solver must ignore)
2nd and 3rd Sheet have the same layout but different values.
I want solver to optimise each sheet individually. For both the solve
will use the same cells e.g. target cell is the same, and cells that
want changed etc.
I want the macro to do this automatically as my workbook is likely t
gain more sheets. I am a novice at visual basic. The macro will b
activated from the summary sheet via a button (I can create th
button)..
This the solver code for both sheet 2 and sheet 3 is shown below, tha
I have recorded:
Sub Macro4()
SolverReset
SolverOk SetCell:="$AI$64", MaxMinVal:=2, ValueOf:="0", ByChange:= _
"$S$15:$S$16,$W$11:$AA$11"
SolverAdd CellRef:="$W$11:$AA$11", Relation:=1, FormulaText:="120"
SolverAdd CellRef:="$S$15:$S$16", Relation:=3, FormulaText:="0.5"
SolverOk SetCell:="$AI$64", MaxMinVal:=2, ValueOf:="0", ByChange:
_
"$S$15:$S$16,$W$11:$AA$11"
SolverSolve UserFinish:=True
End Sub
Is possible for me to use this code and create a macro to achieve m
goal
sheets.
1st Sheet is a summary (solver must ignore)
2nd and 3rd Sheet have the same layout but different values.
I want solver to optimise each sheet individually. For both the solve
will use the same cells e.g. target cell is the same, and cells that
want changed etc.
I want the macro to do this automatically as my workbook is likely t
gain more sheets. I am a novice at visual basic. The macro will b
activated from the summary sheet via a button (I can create th
button)..
This the solver code for both sheet 2 and sheet 3 is shown below, tha
I have recorded:
Sub Macro4()
SolverReset
SolverOk SetCell:="$AI$64", MaxMinVal:=2, ValueOf:="0", ByChange:= _
"$S$15:$S$16,$W$11:$AA$11"
SolverAdd CellRef:="$W$11:$AA$11", Relation:=1, FormulaText:="120"
SolverAdd CellRef:="$S$15:$S$16", Relation:=3, FormulaText:="0.5"
SolverOk SetCell:="$AI$64", MaxMinVal:=2, ValueOf:="0", ByChange:
_
"$S$15:$S$16,$W$11:$AA$11"
SolverSolve UserFinish:=True
End Sub
Is possible for me to use this code and create a macro to achieve m
goal