willemeulen
01-15-2010, 01:58 AM
I have recorded following Solver VBA code
It works fine except I want to set the value to be referenced to cell Q56 (see highlighted), when I adjust the highlighted part to ValueOf:="$Q$56" it doesn't work anymore.
Secondly the code must be triggered when Cell E10 get to a value of 4 or 5 and cell R19=0
Cell R19 will display 1 up and untill all necessary data is completed for the calculations.
Sub Solveyman()
Range("R56").Select
ActiveCell.FormulaR1C1 = "0"
SolverReset
SolverOk SetCell:="$S$56", MaxMinVal:=3, ValueOf:="270.331", ByChange:="$R$56"
SolverSolve True
End Sub
Thanks
It works fine except I want to set the value to be referenced to cell Q56 (see highlighted), when I adjust the highlighted part to ValueOf:="$Q$56" it doesn't work anymore.
Secondly the code must be triggered when Cell E10 get to a value of 4 or 5 and cell R19=0
Cell R19 will display 1 up and untill all necessary data is completed for the calculations.
Sub Solveyman()
Range("R56").Select
ActiveCell.FormulaR1C1 = "0"
SolverReset
SolverOk SetCell:="$S$56", MaxMinVal:=3, ValueOf:="270.331", ByChange:="$R$56"
SolverSolve True
End Sub
Thanks