bluescreamsblack
New Member
- Joined
- Mar 7, 2018
- Messages
- 3
I have a specific solver that I need run, and all the information is organized per row. However, my data set is large and I don't need solver run for all rows. What I would like is to input a value into a cell (BB4), then have the macro search Column E for matching value. Once the row with the matching value is found, run a solver based on information in that row. All rows are set up the same, so column references will be the same regardless of which row is chosen.
Input number into cell $BB$4.
Search column E for cell value matching $BB$4
Set variables for solver based on row
rVa1l = cell (current row, 95)
rVal2 = cell(current row, 50)
rVal3 = range(current row, 25:26)
Run solver with variables from above
SolverOk SetCell:="rVal1", MaxMinVal:=3, ValueOf:=0, ByChange:="rVal3" _
, Engine:=1, EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="rVal1", Relation:=1, FormulaText:="rVal1"
SolverAdd CellRef:="rVal2", Relation:=2, FormulaText:="0"
SolverSolve userFinish:=True
I am not sure if it is possible to run solver with variables, rather than cell references.
Thanks,
Input number into cell $BB$4.
Search column E for cell value matching $BB$4
Set variables for solver based on row
rVa1l = cell (current row, 95)
rVal2 = cell(current row, 50)
rVal3 = range(current row, 25:26)
Run solver with variables from above
SolverOk SetCell:="rVal1", MaxMinVal:=3, ValueOf:=0, ByChange:="rVal3" _
, Engine:=1, EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="rVal1", Relation:=1, FormulaText:="rVal1"
SolverAdd CellRef:="rVal2", Relation:=2, FormulaText:="0"
SolverSolve userFinish:=True
I am not sure if it is possible to run solver with variables, rather than cell references.
Thanks,