Hello,
I have big issues due to this formula. All the cell formulas are vanishing off after running this macro. Plus the final result 18 is not coming but the max result in optimization is outputted. Can anyone help me to protect my cell formulas against solver? Also help on getting 18 result.
Forgot to mention, recorded macros and it made my excel sheet more worse but the macro is working. Im using 365 I believe which is standard right now.
I got a message saying use Code tags, does it mean I have to type CODE: at the beginning please?
Regards
>>> as You've already noted <<<
>>> use code - tags <<<
I'm working on Variance optimization from 2 days with VBA support>>> use code - tags <<<
Code:
(Solver)
Sub TestSolver()
SolverOk SetCell:="$H$13", MaxMinVal:=1, ByChange:="$G$2:$G$6", Engine:=1, EngineDesc:="GRG Nonlinear"
' Add criteria - F3 must be equal to 1
SolverAdd CellRef:="$G$7", Relation:=2, FormulaText:="1"
' Add criteria - H13 must be equal to 18
SolverAdd CellRef:="$H$13", Relation:=2, FormulaText:="18"
' Find a solution by solving the problem
SolverSolve
End Sub
I have big issues due to this formula. All the cell formulas are vanishing off after running this macro. Plus the final result 18 is not coming but the max result in optimization is outputted. Can anyone help me to protect my cell formulas against solver? Also help on getting 18 result.
Forgot to mention, recorded macros and it made my excel sheet more worse but the macro is working. Im using 365 I believe which is standard right now.
I got a message saying use Code tags, does it mean I have to type CODE: at the beginning please?
Regards
Attachments
Last edited: