Macro Debug

T

tcnichols

I'm not a big macro user but I thought I knew how to record and use
one. I went to tools/macros/record new macro and record five solver
calculations and named the marcro "a." Upon running the macro I get
"Compile Error: Sub or Function not defined." Here is the macro text
below. Excel recorded all my movements in setting up the macro so
what's the problem?

' Keyboard Shortcut: Ctrl+a
'
Solverok SetCell:="$L$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$L$12"
SolverSolve
Solverok SetCell:="$K$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$K$12"
SolverSolve
Solverok SetCell:="$J$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$J$12"
SolverSolve
Solverok SetCell:="$I$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$I$12"
SolverSolve
Solverok SetCell:="$H$13", MaxMinVal:=3, ValueOf:="0.18",
ByChange:="$H$12"
SolverSolve
End Sub
 
N

Norman Jones

Hi TC,

Try:
Go to Tools | References in the VBE (Alt F11 -->TR)
This should open the reference list.
Scroll down until you find SOLVER and verify that it is checked.
Alt Q (to return to Excel)
 
N

Norman Jones

Hi TC,
Norman, thanks but References is grayed out. Ideas?

This would happen if you were in break mode.
Try setting the Solver reference after pressing your macro reset button.
 

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