Hi
I've a big problem getting the Constraints in excel solver to use variables.
It seems that the only accepted variable type in the contraints are STRING variables. THe following simple example works AS LONG AS the variable apa is a STRING value and as long as it doesn't contain decimals....
So the question is. How to use varialbes in the FormulaText argement other than string values as integers?
Private Sub CommandButton1_Click()
Dim apa As String
apa = 250
SolverOk SetCell:=[Ctot], MaxMinVal:=1, ValueOf:="0", ByChange:="$B$1,$B$2"
SolverAdd CellRef:=[Ctot], Relation:=1, FormulaText:=apa
SolverAdd CellRef:=[Avar], Relation:=1, FormulaText:="10"
SolverSolve
SolverReset
End Sub
Bookmarks