Solver - VBA not running

Mariner191

Board Regular
Joined
Dec 14, 2007
Messages
123
Mr. Excel,

Attempting to run macro to automate a Solver.
Code errors out on the first appearance of "SolverOk"
SolverOk SetCell:="$U$6",

Error message indicates "Compile Error: Sub or Function not defined".
Please advise.

Thank you in advance,
Mariner191
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi,

First, make sure that the Solver add-in is installed (in the main Excel interface go via Tools | Add-Ins).
Next, in the VBE go to Tools | References and tick the SOLVER reference.

For more information see here:
http://peltiertech.com/Excel/SolverVBA.html


Hope that helps...
 
Upvote 0
Colin_L,

Your solution was on target.
1. VBE go to Tools | References and tick the SOLVER reference
2. Start the code with SolverReset
3. End the code with SolverSolve True

Thank you!
Mariner191
 
Upvote 0

Forum statistics

Threads
1,213,485
Messages
6,113,931
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top