Solver Macro - Sensitivity reports not working

rajiv_bishnoi

New Member
Joined
Jan 13, 2008
Messages
18
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
 
Last edited:

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Watch MrExcel Video

Forum statistics

Threads
1,099,465
Messages
5,468,791
Members
406,607
Latest member
mario antonio

This Week's Hot Topics

Top