rajiv_bishnoi
New Member
- Joined
- Jan 13, 2008
- Messages
- 22
- Office Version
- 365
- Platform
- Windows
Hi,
I recorded a macro, and created a button in the worksheet to assign the macro for running solver, which runs solver and then selects Sensitivity report
When I recorded and ran, it created a new sheet, Sensitivity Report 1.
However, after any changes in inputs etc., when I run the macro, the solver runs but sensitivity report is not created. Any help?
Here is the VBA code
Sub RunOptimizer()
'
' Run solver and create sensitivity sheet
'
SolverOk SetCell:="TotalProfit", MaxMinVal:=1, ValueOf:=0, ByChange:="Variables", _
Engine:=2, EngineDesc:="Simplex LP"
SolverOk SetCell:="TotalProfit", MaxMinVal:=1, ValueOf:=0, ByChange:="Variables", _
Engine:=2, EngineDesc:="Simplex LP"
SolverSolve Userfinish:=True
End Sub
rgds
Rajiv
Ps. Also, I wonder why the same code gets repeated ? FYI, I changed the cell ranges with range names and also added Userfinish:=True
I recorded a macro, and created a button in the worksheet to assign the macro for running solver, which runs solver and then selects Sensitivity report
When I recorded and ran, it created a new sheet, Sensitivity Report 1.
However, after any changes in inputs etc., when I run the macro, the solver runs but sensitivity report is not created. Any help?
Here is the VBA code
Sub RunOptimizer()
'
' Run solver and create sensitivity sheet
'
SolverOk SetCell:="TotalProfit", MaxMinVal:=1, ValueOf:=0, ByChange:="Variables", _
Engine:=2, EngineDesc:="Simplex LP"
SolverOk SetCell:="TotalProfit", MaxMinVal:=1, ValueOf:=0, ByChange:="Variables", _
Engine:=2, EngineDesc:="Simplex LP"
SolverSolve Userfinish:=True
End Sub
rgds
Rajiv
Ps. Also, I wonder why the same code gets repeated ? FYI, I changed the cell ranges with range names and also added Userfinish:=True
Last edited: