M
Mike
I've created a macro by a Solver operation. This is a recorded VB:
-------------------------------------------
Sub Macro15()
'
' Macro15 Macro
'
' Keyboard Shortcut: Ctrl+a
'
SolverOk SetCell:="$H$14", MaxMinVal:=3, ValueOf:="0", ByChange:="$G$14"
SolverAdd CellRef:="$G$14", Relation:=3, FormulaText:="$C$12"
SolverOk SetCell:="$H$14", MaxMinVal:=3, ValueOf:="0", ByChange:="$G$14"
SolverDelete CellRef:="$G$10", Relation:=3, FormulaText:="$C$12"
SolverOk SetCell:="$H$14", MaxMinVal:=3, ValueOf:="0", ByChange:="$G$14"
SolverSolve
ActiveCell.Offset(-2, 0).Range("A1").Select
End Sub
When I tried to run the macro, it did not work:
Compile error:
Sub or Function not defined
And seems it indicates that the SolverOk is not a recognizeable definition.
I'm using MS 2007. The company just install it lately.
The program is now modified to the following by referring to the MS website:
Sub Macro15()
'
' Macro15 Macro
'
' Keyboard Shortcut: Ctrl+a
'
SolverOk SetCell:="$H$14", MaxMinVal:=3, ValueOf:="0", ByChange:="$G$14"
SolverAdd CellRef:="$G$14", Relation:=3, FormulaText:="$C$12"
SolverSolve UserFinish:=True
End Sub
It still does not work and indicates the same problem.
Can anyone help?
-------------------------------------------
Sub Macro15()
'
' Macro15 Macro
'
' Keyboard Shortcut: Ctrl+a
'
SolverOk SetCell:="$H$14", MaxMinVal:=3, ValueOf:="0", ByChange:="$G$14"
SolverAdd CellRef:="$G$14", Relation:=3, FormulaText:="$C$12"
SolverOk SetCell:="$H$14", MaxMinVal:=3, ValueOf:="0", ByChange:="$G$14"
SolverDelete CellRef:="$G$10", Relation:=3, FormulaText:="$C$12"
SolverOk SetCell:="$H$14", MaxMinVal:=3, ValueOf:="0", ByChange:="$G$14"
SolverSolve
ActiveCell.Offset(-2, 0).Range("A1").Select
End Sub
When I tried to run the macro, it did not work:
Compile error:
Sub or Function not defined
And seems it indicates that the SolverOk is not a recognizeable definition.
I'm using MS 2007. The company just install it lately.
The program is now modified to the following by referring to the MS website:
Sub Macro15()
'
' Macro15 Macro
'
' Keyboard Shortcut: Ctrl+a
'
SolverOk SetCell:="$H$14", MaxMinVal:=3, ValueOf:="0", ByChange:="$G$14"
SolverAdd CellRef:="$G$14", Relation:=3, FormulaText:="$C$12"
SolverSolve UserFinish:=True
End Sub
It still does not work and indicates the same problem.
Can anyone help?