I recognize this is a common problem and I have researched the help forums but yet I cannot figure out what is knowing wrong. I am admittedly a novice when it comes to macros. I am trying to predict values for column "U" (mutiple rows) based on AI and the given constraint.
For now, I am getting a run 1004 error on the "Do While Not..." line, but I fear more errors are coming.
Thanks.
Worksheets("Beirut").Activate
Do While Not IsEmpty(Worksheets("Beirut").Range("U" & RowCount))
RowCount = 2
SolverReset
SolverOk SetCell:="AI" & RowCount, MaxMinVal:=1, ValueOf:="0", ByChange:="U" & RowCount
SolverAdd CellRef:="AJ" & RowCount, Relation:=1, FormulaText:="T" + RowCount
SolverOk SetCell:="AI" & RowCount, MaxMinVal:=1, ValueOf:="0", ByChange:="U" & RowCount
SolverSolve userFinish:=True
SolverFinish keepFinal:=1
RowCount = RowCount + 1
Loop
End Sub
Bookmarks