ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Activate the solver witin a macro (https://www.excelbanter.com/excel-programming/391954-activate-solver-witin-macro.html)

P Sellmeijer

Activate the solver witin a macro
 
Hi
How shoud i activate the solver (if possible) from a macro?

Peter

Mike H

Activate the solver witin a macro
 
Hi,

Try:-

Sub ordinate()
SolverOk SetCell:="$C$1", MaxMinVal:=3, ValueOf:="8", ByChange:="$A$1"
SolverSolve
End Sub

Mike


"P Sellmeijer" wrote:

Hi
How shoud i activate the solver (if possible) from a macro?

Peter


P Sellmeijer

Activate the solver witin a macro
 
Hi Mike,

Thanks for your reply.
Unfortunaly while running your macro i get an error at 'SolverOk" or
"SolverSolve"
with the comment "Sub or Function not5 defined".
I suppose that something should be declaired, but i do'nt know.

Peter

Try:-

Sub ordinate()
SolverOk SetCell:="$C$1", MaxMinVal:=3, ValueOf:="8", ByChange:="$A$1"
SolverSolve
End Sub

Mike


"P Sellmeijer" wrote:

Hi
How shoud i activate the solver (if possible) from a macro?

Peter



Tushar Mehta[_3_]

Activate the solver witin a macro
 
Look up any Solver related topic (for example SolverSolve) in XL VBA
help. The 2nd paragraph will tell you what you have to do to make it
work.

In article ,
says...
Hi Mike,


Thanks for your reply.
Unfortunaly while running your macro i get an error at 'SolverOk" or
"SolverSolve"
with the comment "Sub or Function not5 defined".
I suppose that something should be declaired, but i do'nt know.

Peter

Try:-

Sub ordinate()
SolverOk SetCell:="$C$1", MaxMinVal:=3, ValueOf:="8", ByChange:="$A$1"
SolverSolve
End Sub

Mike


"P Sellmeijer" wrote:

Hi
How shoud i activate the solver (if possible) from a macro?

Peter





All times are GMT +1. The time now is 09:56 PM.

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