Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
solver
i recorded a macro while using the solver function, which worked, but when i
tried to re-use the code that it had recorded, it said "sub or function not defined" and highlighted "SolverOk" sub test() SolverOk SetCell:="$G$1", MaxMinVal:=3, ValueOf:=".0124", ByChange:="$G$2" SolverSolve end sub any thoughts? thanks, mike allen |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
solver
Hi Mike,
You need to set a reference to the Solver add-in for this to work. First, make sure Solver is actually open by choosing Tools/Solver from the Excel menu and then just closing the Solver dialog (the Solver add-in won't necessarily be open when you first start Excel because it's a demand-loaded add-in). Next activate the workbook with your code in it and choose Alt+F11 to open the Visual Basic Editor. From the VBE menu choose Tools/References. Put a check mark beside the reference called SOLVER. Save your workbook. The code should run now. -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "mike allen" wrote in message ... i recorded a macro while using the solver function, which worked, but when i tried to re-use the code that it had recorded, it said "sub or function not defined" and highlighted "SolverOk" sub test() SolverOk SetCell:="$G$1", MaxMinVal:=3, ValueOf:=".0124", ByChange:="$G$2" SolverSolve end sub any thoughts? thanks, mike allen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using Solver | Excel Discussion (Misc queries) | |||
Using solver | Excel Worksheet Functions | |||
Solver | Excel Worksheet Functions | |||
need help in SOLVER !! | Excel Discussion (Misc queries) | |||
Interesting Solver problem (Solver encounters an error) | Excel Discussion (Misc queries) |