Hi, I'm running solver within a macro which runs the solver multiple times, changing one variable each time and pasting the results into another worksheet. Unfortunately the solver seems to get stuck on a solution and makes the same allocation decision each time. The code for the solver part is below. There is a minimum allocation to one enterprise which a collegue suggested I incorporate by changing the starting points using the 'npoints' code. If you need more information please let me know, I just didn't want to post all the extra code and the workbook if not needed because it's a large file.
Dim npoints As Single
Dim icol As Integer
npoints = Worksheets("Euc OptN").Cells(62, 2).Value
icol = 2
For i = 1 To npoints
ActiveSheet.Range(Cells(60, icol), Cells(61, icol)).Select
Selection.Copy
Range("B55").Select
ActiveSheet.Paste
SolverOk SetCell:="$B$45", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$B55:$B$56"
SolverOptions AssumeLinear:=False, AssumeNonNeg:=True
SolverSolve UserFinish:=True
Range("B45").Select
Selection.Copy
ActiveSheet.Cells(64, icol).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
icol = icol + 1
Next i
Thanks.
Dim npoints As Single
Dim icol As Integer
npoints = Worksheets("Euc OptN").Cells(62, 2).Value
icol = 2
For i = 1 To npoints
ActiveSheet.Range(Cells(60, icol), Cells(61, icol)).Select
Selection.Copy
Range("B55").Select
ActiveSheet.Paste
SolverOk SetCell:="$B$45", MaxMinVal:=1, ValueOf:="0", ByChange:= _
"$B55:$B$56"
SolverOptions AssumeLinear:=False, AssumeNonNeg:=True
SolverSolve UserFinish:=True
Range("B45").Select
Selection.Copy
ActiveSheet.Cells(64, icol).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
icol = icol + 1
Next i
Thanks.