Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Visual Basic Macro For Solver


I would like to know how to creat a macro for Resetill all
the Solver options, before assinging parameters and run
it. The follwing example, taken from the microsoft
website, illustrates what´s going on. The macro runs okay,
but each time is saving the constraints on the window. I
presume it must be added an argument to reset all before.
Any help will be appreciated.

Velero


http://support.microsoft.com/default.aspx?
scid=/support/excel/content/solver/solver.asp

Sub Maximum_Profit()


Solverok setcell:=Range("G14"), maxminval:=1, _
bychange:=Range("G9:I9")
SolverAdd CellRef:=Range("E3:E7"), Relation:=1, _
FormulaText:="$B$3:$B$7"
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Visual Basic Macro For Solver

"Velero" wrote in news:11fec01c3f64f$e46772e0
:

I would like to know how to creat a macro for Resetill all
the Solver options, before assinging parameters and run
it. The follwing example, taken from the microsoft
website, illustrates whatïs going on. The macro runs okay,
but each time is saving the constraints on the window. I
presume it must be added an argument to reset all before.


Are you saying that you want the macro to note what the existing options
are for Solver, save them somewhere, and restore them to the solver dialog
box after it completes?

I don't think that's possible.

--
My email address has an extra @ (spell it out) and an extra invalid. Please
remove them if you are not a spammer or list broker and want to reply.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Visual Basic Macro For Solver

No, I am not saying that. Let me explain it again

I want to write a macro for running solver. The problem is
that each time you run it the Solver window in Excel is
saving the constraints (adding again the arguments in the
constraint window). I need to add an argument in order to
Reset all before seting the target, changing, and
constraint arguments.

Does this help as explanation?

Thanks for your answer

Velero


-----Original Message-----
"Velero" wrote in

news:11fec01c3f64f$e46772e0
:

I would like to know how to creat a macro for Resetill

all
the Solver options, before assinging parameters and run
it. The follwing example, taken from the microsoft
website, illustrates whatïs going on. The macro runs

okay,
but each time is saving the constraints on the window.

I
presume it must be added an argument to reset all

before.

Are you saying that you want the macro to note what the

existing options
are for Solver, save them somewhere, and restore them to

the solver dialog
box after it completes?

I don't think that's possible.

--
My email address has an extra @ (spell it out) and an

extra invalid. Please
remove them if you are not a spammer or list broker and

want to reply.
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default Visual Basic Macro For Solver

Is this what you are looking for?

SolverReset

SolverOk _
SetCell:=Range("G14"), _
MaxMinVal:=1, _
ByChange:=Range("G9:I9")

'...etc


Not sure, but for Jonathan's idea, I believe "SolverSave" and "SolverLoad"
are one method of saving/loading Solver options.
HTH.

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Verlero" wrote in message
...
No, I am not saying that. Let me explain it again

I want to write a macro for running solver. The problem is
that each time you run it the Solver window in Excel is
saving the constraints (adding again the arguments in the
constraint window). I need to add an argument in order to
Reset all before seting the target, changing, and
constraint arguments.

Does this help as explanation?

Thanks for your answer

Velero


-----Original Message-----
"Velero" wrote in

news:11fec01c3f64f$e46772e0
:

I would like to know how to creat a macro for Resetill

all
the Solver options, before assinging parameters and run
it. The follwing example, taken from the microsoft
website, illustrates whatïs going on. The macro runs

okay,
but each time is saving the constraints on the window.

I
presume it must be added an argument to reset all

before.

Are you saying that you want the macro to note what the

existing options
are for Solver, save them somewhere, and restore them to

the solver dialog
box after it completes?

I don't think that's possible.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Visual Basic Macro Clarence Excel Discussion (Misc queries) 1 March 24th 10 08:06 PM
Visual Basic Autoshapes Macro Dav Excel Discussion (Misc queries) 2 December 14th 05 05:33 PM
MS Visual Basic Error...from MAcro G118 Excel Discussion (Misc queries) 0 December 12th 05 05:56 PM
Visual Basic Macro negzel Excel Discussion (Misc queries) 1 December 28th 04 10:53 PM
visual basic macro in excel Patrick Molloy Excel Programming 0 July 23rd 03 07:49 AM


All times are GMT +1. The time now is 11:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"