VBA Solver FormulaText

  • Thread starter Thread starter Jonathan
  • Start date Start date
J

Jonathan

I have been trying to run a macro using the Solver add-in.
The macro makes calculations and solves for the unknowns
in one column. I then try to use a For..Next loop to
complete the similar calculations in the following columns
using data from only that "nth" columns.

I am having problems getting the FormulaText option in the
SolverAdd command to run with the for loop. I have been
trying:

SolverAdd CellRef:=Cells(56, 3 + j - 1), Relation:=2,
FormulaText:=Worksheets("Given_Moment").Cells(57, 3 + j - 1)

But I only can get the following to work, which only works
with the first column: SolverAdd CellRef:=Cells(56, 3 + j -
1), Relation:=2, FormulaText:="$C$57"

Is there any way to have the FormulaText value read a
"relative" data type or cell in a column?

Thank you for your help!
 
Back
Top