LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Excel Solver multiple times with macros

Here is what i came up with to solve the same problem... the (True,True) term
was not working for me....


Sub solveAlls()

MsgBox "SolveAlls"

Dim cellChange

Dim cellGoal

Dim Nmm

Set cellChange = ActiveSheet.Application.InputBox("Please the 1st cell you
wish to vary", , , , , , , 8)
'Following cells that want to be varied must be in teh range of Nmm... and
below "cellChange"

Set cellGoal = ActiveSheet.Application.InputBox("Corressponding Cell to
Zero", , , , , , , 8)

Set Nmm = ActiveSheet.Application.InputBox("Range", , , , , , , 8)
'If 8 rows of data need to be solved for... this would be 8



Dim j As Integer

j = Nmm.Rows.Count

MsgBox "j = " & j









For i = 1 To j

MsgBox "i=" & i
SolverReset

SolverOK SetCell:=cellGoal.Address, MaxMinVal:=3, ValueOf:="0",
ByChange:=cellChange.Address
SolverSolve userFinish:=True
SolverFinish KeepFinal:=1

Set cellChange = cellChange.Offset(1, 0)
Set cellGoal = cellGoal.Offset(1, 0)

Next i
MsgBox "done"
End Sub
 
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
How do I use Excel Solver (for an Iteration in a row) for several no.of times? Deepak[_2_] Excel Discussion (Misc queries) 0 December 9th 08 06:35 AM
solver in macros Gabru Excel Discussion (Misc queries) 0 September 1st 06 04:05 PM
webquery and solver macros icestationzbra Excel Discussion (Misc queries) 2 February 23rd 06 06:47 PM
Solver, macros Excel scaroca Excel Worksheet Functions 2 September 6th 05 01:34 AM
Using solver in macros - Help TOBY Excel Programming 0 July 13th 04 09:36 AM


All times are GMT +1. The time now is 08:54 AM.

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"