Excel 2010 on Windows 7
I am using an Excel spreadsheet with a simple solver macro.
The following macro works but when I change the Value Of:= to reference a cell in the worksheet it doesn't work any longer.
In the macro I want to have the "...Value Of:=0.13"... part of the instructions refer directly to a cell that can be changed (e.g. "...Value Of:="$D$100...") but the macro doesn't seem to work when I try this. Can the Value Of be dynamic? Am I just writing the macro incorrectly?
Sub Macro2()
'
' Macro2 Macro
'
'
SolverOk SetCell:="$D$108", MaxMinVal:=3, ValueOf:=0.13, ByChange:="$S$106", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverOk SetCell:="$D$108", MaxMinVal:=3, ValueOf:=0.13, ByChange:="$S$106", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve
End Sub
I am using an Excel spreadsheet with a simple solver macro.
The following macro works but when I change the Value Of:= to reference a cell in the worksheet it doesn't work any longer.
In the macro I want to have the "...Value Of:=0.13"... part of the instructions refer directly to a cell that can be changed (e.g. "...Value Of:="$D$100...") but the macro doesn't seem to work when I try this. Can the Value Of be dynamic? Am I just writing the macro incorrectly?
Sub Macro2()
'
' Macro2 Macro
'
'
SolverOk SetCell:="$D$108", MaxMinVal:=3, ValueOf:=0.13, ByChange:="$S$106", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverOk SetCell:="$D$108", MaxMinVal:=3, ValueOf:=0.13, ByChange:="$S$106", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve
End Sub