December 8, 2016
I have the following vBA code to automate Solver, and need it amended to that it runs without bgetting a run time error "SAub or function not defined
I also need the following changes:
1) I need ValueOf:=72 to refer to cell F1 so that this will change each time F1 is amendedd
2) I need $E$$27 to refer to the last cell in Col D in ByChange:="$E$2:$E$27" for EG "$E2:$E$" & Lastrow
Option Explicit
Sub Solver()
SolverOk SetCell:="$E$1", MaxMinVal:=3, ValueOf:=72, ByChange:="$E$2:$E$27", _
Engine:=2, EngineDesc:="Simplex LP"
SolverOk SetCell:="$E$1", MaxMinVal:=3, ValueOf:=72, ByChange:="$E$2:$E$27", _
Engine:=2, EngineDesc:="Simplex LP"
SolverSolve
End Sub
I have also posted on Amend solver VBA Code | MrExcel Message Board and Macro to automate Solver (excelforum.com)
1 Guest(s)