Hi,
I am trying to write some code in visual basic using Solver. I recorded a macro in Excel (Office XP) to create the code. However, when I run my macro, Excel says that the functions are undefined. This is the section of code that is causing me trouble:
SolverOk SetCell:="$M$2", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$G$2,$G$7,$G$10,$G$13,$G$15"
SolverAdd CellRef:="$G$2", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$G$7", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$G$10", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$G$13", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$G$15", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$G$17", Relation:=2, FormulaText:="1"
SolverAdd CellRef:="$M$2", Relation:=2, FormulaText:="$B$20"
SolverOk SetCell:="$M$2", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$G$2,$G$7,$G$10,$G$13,$G$15"
SolverSolve
Any help at all would be greatly appreciated.
Thanks,
I am trying to write some code in visual basic using Solver. I recorded a macro in Excel (Office XP) to create the code. However, when I run my macro, Excel says that the functions are undefined. This is the section of code that is causing me trouble:
SolverOk SetCell:="$M$2", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$G$2,$G$7,$G$10,$G$13,$G$15"
SolverAdd CellRef:="$G$2", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$G$7", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$G$10", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$G$13", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$G$15", Relation:=3, FormulaText:="0"
SolverAdd CellRef:="$G$17", Relation:=2, FormulaText:="1"
SolverAdd CellRef:="$M$2", Relation:=2, FormulaText:="$B$20"
SolverOk SetCell:="$M$2", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$G$2,$G$7,$G$10,$G$13,$G$15"
SolverSolve
Any help at all would be greatly appreciated.
Thanks,