I have recorded a solver macro as per below.
I'd like to know how to make the column reference throughout the macro (in the below case "BH") change to be the column of the active cell.
SolverOk SetCell:="BH172", MaxMinVal:=1, ValueOf:=0, ByChange:="BH$51", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="$BH$51", Relation:=1, FormulaText:="1"
SolverOk SetCell:="$BH$172", MaxMinVal:=1, ValueOf:=0, ByChange:="$BH$51", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverDelete CellRef:="$BI$62", Relation:=1, FormulaText:="$BI$89"
SolverAdd CellRef:="$BH$62", Relation:=1, FormulaText:="$BH$89"
SolverOk SetCell:="$BH$172", MaxMinVal:=1, ValueOf:=0, ByChange:="$BH$51", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverDelete CellRef:="$BI$62", Relation:=3, FormulaText:="$BI$88/0.97"
SolverAdd CellRef:="$BH$62", Relation:=3, FormulaText:="$BH$88/0.97"
SolverOk SetCell:="$BH$172", MaxMinVal:=1, ValueOf:=0, ByChange:="$BH$51", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverOk SetCell:="$BH$172", MaxMinVal:=1, ValueOf:=0, ByChange:="$BH$51", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve
Range("BI97").Select
End Sub
I'd like to know how to make the column reference throughout the macro (in the below case "BH") change to be the column of the active cell.
SolverOk SetCell:="BH172", MaxMinVal:=1, ValueOf:=0, ByChange:="BH$51", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="$BH$51", Relation:=1, FormulaText:="1"
SolverOk SetCell:="$BH$172", MaxMinVal:=1, ValueOf:=0, ByChange:="$BH$51", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverDelete CellRef:="$BI$62", Relation:=1, FormulaText:="$BI$89"
SolverAdd CellRef:="$BH$62", Relation:=1, FormulaText:="$BH$89"
SolverOk SetCell:="$BH$172", MaxMinVal:=1, ValueOf:=0, ByChange:="$BH$51", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverDelete CellRef:="$BI$62", Relation:=3, FormulaText:="$BI$88/0.97"
SolverAdd CellRef:="$BH$62", Relation:=3, FormulaText:="$BH$88/0.97"
SolverOk SetCell:="$BH$172", MaxMinVal:=1, ValueOf:=0, ByChange:="$BH$51", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverOk SetCell:="$BH$172", MaxMinVal:=1, ValueOf:=0, ByChange:="$BH$51", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve
Range("BI97").Select
End Sub