LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do I get solver to excute more than one time

Using Solver in VBA I created the following little macro:

Sub SolverMacro()
' My Example of a Solver VBA Macro using variables
Dim rng1 As Variant
Dim rng2 As Variant
Dim rng3 As Variant

rng1 = "$BL$11:$BL$58"
rng2 = "$BR$58"
rng3 = "$BL$11:$BL$58"

SolverReset
SolverOk SetCell:=rng1, _
MaxMinVal:=3, _
ValueOf:="0", _
ByChange:=rng2
SolverAdd CellRef:=rng3, Relation:=3, FormulaText:="0"
SolverSolve
End Sub

Needless to say it would not repeat, it would go thru the code but change
nothing. I then created a macro with the macro recoder:
Sub Macro2()
SolverOk SetCell:="$BR$58", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$BL$11:$BL$58"
SolverSolve
End Sub
However like the first macro it would not repeat. When I try to use it again
it goes thru the routine but changes nothing. I made manual changes to the
range "$BL$11:$BL$58" to check if the macro was working and it changed nothing

When I use the solver by manually entering the data into the solver fields
it works ok. What am I doing wrong and how do I get Solver to work more than
time using VBA


 
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
Solver installes itself a second time :S TigerDS Excel Worksheet Functions 2 December 9th 08 10:51 AM
loop to excute data VBNewbie Excel Programming 5 July 19th 06 01:16 PM
How to use solver to schedule part time and full time workforce? The Ooz Excel Discussion (Misc queries) 0 August 18th 05 06:53 AM
error to excute cut or copy in vba programming Netstar Excel Programming 2 September 22nd 04 02:11 AM
Excute a Excel worksheet with Task Scheduler Randy[_15_] Excel Programming 0 September 8th 04 01:53 PM


All times are GMT +1. The time now is 04:45 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"