Hi all,
I'm having a problem setting up a vba solver loop. I have several columns of data, Columns A-L. I am simply trying to get all of the cells in column L set to zero by changing the values in column K. Column L has a simple formula linked to Column K and a few other cells. For my purposes I only want to adjust Column K. So K2 adjusts L2, K3 adjusts L3, etc..
I have 326 entries so I can't do it manually.
This is the script I wrote, but it only returns row 1, and nothing past it.
Sub SolverMacro()
Dim k As Long
For k = 2 To 326
SolverReset
SolverOk SetCell:="$L2", _
MaxMinVal:=3, _
ValueOf:="0", _
ByChange:="$K2"
SolverSolve userFinish:=True
Next k
End Sub
Can anyone find the errors in it? I'm very new at this, so please explain it as simply as possible. Thanks in advance for your help.
Ed
Bookmarks