Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

non linear optimization with Excel solver

Status
Not open for further replies.

quayz15

Programmer
Jun 16, 2009
12
US
Is there a way to solve for a range of cells simultaniously? I need to best fit a curve where I need to set cells $E$14 : $E$417 = $D$14 : $D$417
by changing rows D2 : M2. Here is what I have, is there a way to adjust this code to do a best fit?

Sub BoucwenSOLVER()
For Row = 14 To 417
SolverOk SetCell:=Range("$E$1").offset(row-1,0).Address, MaxMinVal:=3, ValueOf:=Range("$D$1").offset(row-1,0).Value, ByChange:= _
"$D$2:$M$2"
SolverAdd CellRef:="$H$2", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$I$2", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$J$2", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$E$2", Relation:=1, FormulaText:="2"
SolverAdd CellRef:="$E$2", Relation:=3, FormulaText:="1"
SolverSolve

Next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top