View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
toby toby is offline
external usenet poster
 
Posts: 4
Default Using solver in macros - Help

Anyone give us an idea about this one?. When I run this
basic macro, the settings of SolverOK do NOT get inputted
into the solver addin but the constraints do. (i.e.
SolverAdd works, SolverOK does not). I have tried using
R1C1 notation as suggested by help queries and same thing
happens (or doesn't happen!). If I manually record, VBA
recognises that I am using SolverOK and records my
actions, but when I play back, the macro totally ignores
the solverOK line. Any suggestions? Thanks Toby

Sub SolveMacro()
SolverReset
SolverAdd CellRef:="$B$1", Relation:=2,
FormulaText:="0.1"
SolverOK SetCell:="$A$1", MaxMinVal:=1, ValueOf:="0",
ByChange:="$C$1:$C$4"
SolverSolve True
End Sub