Using Solver in a Macro

S

Scot

I have created a spreadsheet that does a series of calculations. One of the
calculations requires the use of the Solver. The solver refers to a value
in a cell on the spreadsheet. I created a macro to run the series of
calculations, but it gets stuck on the solver apparently at the point it
needs the value from a cell. My question is: How can I get the macro to
perform the solver function and keep going?

Scot
 
K

Ken Wright

You need to set a reference to Solver in order to get it to work initially, eg
within the VBE do Tools / references / Check the 'Solver' option.

When you record the code to go into your macro you will have a line that looks
like this at the end

SolverSolve

If you want it to automatically populate the cell with the value without the
user having to OK it, then you need to manually add (True):-

SolverSolve (True)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top