hello all,
I am having issues with the code below. Firstly when i run it on occassion there is no feasible solution which is fine it will happen on occassion. Though the popup telling me there is no feasible solution i would like to prevent from popping up. I thought the UserFinish:=True was supposed to do this. is there something i can put in the code below to prevent this from happening. Secondly the the macro is being called even though there is no "y" in j14 any ideas why? Any help appreciated.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("J14").Value = "y" Then
Call Freeme
End If
End Sub
Sub Freeme()
SolverReset
SolverOk SetCell:="$H$35", _
MaxMinVal:=2, _
ValueOf:=0, _
ByChange:="$G$22:$L$22", _
Engine:=1, _
EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:=Range("$G$22:$L$22"), Relation:=1, FormulaText:="20"
SolverAdd CellRef:=Range("$G$22:$L$22"), Relation:=3, FormulaText:="2"
SolverAdd CellRef:=Range("$H$24:$H$33"), Relation:=3, FormulaText:="0"
SolverSolve
SolverSolve UserFinish:=True
SolverFinish KeepFinal:=1
End Sub
Regards
Dan
Bookmarks