Hello,
I'm relatively new to VB, and to the forum, I'd appreciate your help with the following.
I'm trying to use solver to optimise a value in cell O5 so that it's identical to a value in cell P5 by changing cells E5 & F5. I'm also trying to loop the code so that the sequence is repeated for every subsequent row until row 781.
I've so far tried using the following code, but to no avail:
Sub SolverMacro()
Dim r As Long
For r = 2 To 781
SolverOk SetCell:="O5", MaxMinVal:=0, ValueOf:=Range("P5").Value, ByChange:="E5:F5", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve UserFinish:=True
Next r
End Sub
Can anyone point out where I'm going wrong, or give me any pointers please?
Bookmarks