If you still have to use Solver after reading Dana's post...
The easiest way to use Solver is to solve different problems is to set
each up anew and use SolverReset to reset the previous conditions. So,
in the simple example of the 'Set Cell' being column E and the 'By
changing cell' being column B, and the different problems constructed
in rows 2:10, one would use the untested:
for i=2 to 10
SolverReset
SolverOk SetCell:="$E$" & cstr(i), MaxMinVal:=3, _
ValueOf:="0", ByChange:="$B$" & cstr(i)
SolverSolve
SolverFinish 'I believe you will need this; check the help
Next i
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
In article ,
says...
I'm trying to help a friend with this one. He has about 5,000
equations, which for the sake of discussion can be taken of the form
2*x^2 - 5*x + 1.
The multiplicity of equations comes about because each eqn. has a
different coefficient of the linear term in x. So the picture is
something like this: there is a column of (say) 5000 values of the
linear coefficient - in column A, say. Column B holds the quadratic,
using the linear coefficient from Col. A.
What he wants to do is to repeatedly apply Solver to all these
equations in turn. I am (very) weak in VBA, but this simple
macro/program (basically obtained by recording) does work ok,
interactively, for one equation:
Sub Solve()
SolverOk SetCell:="$E$2", MaxMinVal:=3, ValueOf:="0", ByChange:="$B$2"
SolverSolve
End Sub
Would anyone have any ideas which would help to streamline the process
of obtaining the solution of 5000 such equations?
Thanks very much for any advice,
John Cordes