I'm always amazed at the number of mind-readers we have in this
newsgroup, but I'd be surprised if anyone can figure out what you are
trying to accomplish (I'm often surprised, though).
Could you be (much) more specific, perhaps with an example?
--
Regards,
Vasant.
**No direct emails please--keep discussion in newsgroup.**
"friendlyyyyy" <ema...@msn.com> wrote in message
news:77c90ec1.02062...@posting.google.com...
This might help:
Creating Visual Basic Macros that Use Microsoft Excel Solver
http://support.microsoft.com/support/Excel/Content/Solver/SOLVER.asp
Regards,
Tom Ogilvy
Vasant Nanavati <vas...@aol.com> wrote in message
news:OqgTRj$GCHA.2472@tkmsftngp11...
With just two cells, would GoalSeek work for you?
Range("A1").GoalSeek Goal:=100, ChangingCell:=Range("B1")
or in a loop...
Cells(j, 1).GoalSeek Goal:=100, ChangingCell:=Cells(j, 2)
--
Dana DeLouis
Windows XP & Office XP
= = = = = = = = = = = = = = = = =
"friendlyyyyy" <ema...@msn.com> wrote in message
news:77c90ec1.02062...@posting.google.com...
For J = 0 To 5
firstrange = Range("C14")
secondrange = Range("G6")
first = firstrange.Offset(J, 0)
ssecond = secondrange.Offset(0, J)
SolverOk SetCell:=ssecond, MaxMinVal:=3, ValueOf:=0,
ByChange:=first
SolverSolve
Next J
"Dana DeLouis" <ng_...@hotmail.com> wrote in message news:<#cZUFcAHCHA.1844@tkmsftngp11>...
dim ChangeCell as range, TargetCell as range, j as integer
set changecell=activesheet.range("C14")
set targetcell=activesheet.range("G6")
for j=0 to 5
solverreset
solverok setcell:=targetcell.offset(j,0), _
MaxMinVal:=3, ValueOf:=0, _
bychange:=changecell.offset(j,0)
solversolve
next j
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Microsoft MVP -- Excel
--
In <77c90ec1.02062...@posting.google.com>, friendlyyyyy
<ema...@msn.com> wrote
Just to point this out, you are setting these to values, and not to a
"Range" object.
You will want to use "Set."
Also in a loop, you will most likely want to use:
SolverSolve UserFinish:=True
Just a little side note. My personal opinion is that "Frontline" has this
setting backwards.
"UserFinish:=True" looks like the user should be involved with interacting
with the standard Solver Results dialog box.
You, the user, do not want to finish it, so it appears to me that the
appropriate setting should be False.
Well, that's my 2 cents worth!
Something like...
For j = 0 To 5
Set firstrange = Range("C14").Offset(j, 0)
Set secondrange = Range("G6").Offset(0, j)
SolverOk _
SetCell:=secondrange, _
MaxMinVal:=3, _
ValueOf:=0, _
ByChange:=firstrange
SolverSolve UserFinish:=True
Next j
--
Dana DeLouis
Windows XP & Office XP
= = = = = = = = = = = = = = = = =
"friendlyyyyy" <ema...@msn.com> wrote in message
news:77c90ec1.02062...@posting.google.com...
Tushar Mehta <ng_p...@bigfoot.com> wrote in message news:<MPG.1782ac2ef...@msnews.microsoft.com>...