Hello, I'm trying to assign the solver function to a command button in VBA but it says there is an error. My solver code is like this (I used record macro)
and i pasted it under my command button but it says error. how can i change this?
Sub solver() SolverOk SetCell:="$B$35", MaxMinVal:=1, ValueOf:=0, ByChange:="$B$25:$H$31", _ Engine:=2, EngineDesc:="Simplex LP" SolverOk SetCell:="$B$35", MaxMinVal:=1, ValueOf:=0, ByChange:="$B$25:$H$31", _ Engine:=2, EngineDesc:="Simplex LP" SolverSolve End Sub |
and i pasted it under my command button but it says error. how can i change this?
Private Sub cmbassign_Click() SolverOk SetCell:="$B$35", MaxMinVal:=1, ValueOf:=0, ByChange:="$B$25:$H$31", _ Engine:=2, EngineDesc:="Simplex LP" SolverOk SetCell:="$B$35", MaxMinVal:=1, ValueOf:=0, ByChange:="$B$25:$H$31", _ Engine:=2, EngineDesc:="Simplex LP" SolverSolve End Sub |