ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Solver FormulaText (https://www.excelbanter.com/excel-programming/289122-vba-solver-formulatext.html)

Jonathan[_9_]

VBA Solver FormulaText
 
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!


All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com