ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Problems (https://www.excelbanter.com/excel-programming/343793-macro-problems.html)

unique

Macro Problems
 
Hello,

I want to automate a 'solve' procedure by using a macro button. The solve
works when manually done. But when I use a button, I get the following
compiler error.

Sub or function not defined.

Sub solve()
'
' solve Macro
' Macro recorded 25/10/2005 by IT Services
'

'
solverok SetCell:="$E$9", MaxMinVal:=2, ValueOf:="0",
ByChange:="$D$2:$D$7"
SolverSolve
End Sub



solverok is the highlighted part, that it refers to.

regards


Jim Rech

Macro Problems
 
You need to go into Tools, References in the VBE and set a reference to
SOLVER.

--
Jim
"unique" wrote in message
...
| Hello,
|
| I want to automate a 'solve' procedure by using a macro button. The solve
| works when manually done. But when I use a button, I get the following
| compiler error.
|
| Sub or function not defined.
|
| Sub solve()
| '
| ' solve Macro
| ' Macro recorded 25/10/2005 by IT Services
| '
|
| '
| solverok SetCell:="$E$9", MaxMinVal:=2, ValueOf:="0",
| ByChange:="$D$2:$D$7"
| SolverSolve
| End Sub
|
|
|
| solverok is the highlighted part, that it refers to.
|
| regards
|




All times are GMT +1. The time now is 04:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com