PDA

View Full Version : Muti Solver VBA



anon
03-02-2013, 01:28 AM
Hi guys i'm trying to set up a macro with solver functions to carry out a solver operation on each of my lines,

I'm trying to use the cells(x,y) feature to call the solver operations, but for some reason this is not working - and i'm not getting any errors

any ideas why ??

the solver part looks something like this

where i is being iterated for each row.
________________________________________________
For i = 5 To 20

SolverReset
SolverOk SetCell:="Cells(i, 11)", MaxMinVal:=1, ValueOf:=0, ByChange:=Range(Cells(i, 7), Cells(i, 9)), Engine:=1, EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="(Cells(i, 7))", Relation:=3, FormulaText:="1"
SolverAdd CellRef:="(Cells(i, 7))", Relation:=4, FormulaText:="integer"
SolverAdd CellRef:="(Cells(i, 9))", Relation:=3, FormulaText:="1"
SolverAdd CellRef:="(Cells(i, 9))", Relation:=4, FormulaText:="integer"
SolverAdd CellRef:="(Cells(i, 13))", Relation:=3, FormulaText:="Cells(i, 6)"

SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1
Next i
End Sub