SolverSolve UserFinish:=True--Solver Results Dialog Box Still Appears

5608

New Member
Joined
Apr 2, 2009
Messages
1
I have a looping macro using solver and I cannot seem to get the solver results dialog box to stop appearing after each calculation. I have the "SolverSolve UserFinish:=True" in my code, below. Can anyone help me with what I am doin wrong?

' Macro4 Macro
' Macro recorded 4/2/2009 by
'
Sheets("DataTable").Select
Range("a2").Select
Selection.Copy
Sheets("Model").Select
Range("H13").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("DataTable").Select
Range("b2").Select
Selection.Copy
Sheets("Model").Select
Range("H8").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
SolverReset
SolverOk SetCell:="$0$1", MaxMinVal:=3, ValueOf:="0", ByChange:="$H$7"
SolverSolve
SolverSolve userFinish:=True
SolverFinish KeepFinal:=1
Range("H7").Select
Selection.Copy
Sheets("DataTable").Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Do
Sheets("DataTable").Select
ActiveCell.Offset(1, -2).Range("A1").Select
Selection.Copy
Sheets("Model").Select
Range("H13").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("DataTable").Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.Copy
Sheets("Model").Select
Range("H8").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
SolverReset
SolverOk SetCell:="$o$1", MaxMinVal:=3, ValueOf:="0", ByChange:="$H$7"
SolverSolve
SolverSolve userFinish:=True
SolverFinish KeepFinal:=1
Range("H7").Select
Selection.Copy
Sheets("DataTable").Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Loop Until ActiveCell = "Stop"
End Sub

Thanks for the help!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

MyHero

New Member
Joined
Jan 22, 2009
Messages
26
I don't know if you ever figured it out, and I hope you did considering it was asked more than three years ago. I ran into the same problem today, and I figured it out:

' Macro4 Macro
' Macro recorded 4/2/2009 by
'
Sheets("DataTable").Select
Range("a2").Select
Selection.Copy
Sheets("Model").Select
Range("H13").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("DataTable").Select
Range("b2").Select
Selection.Copy
Sheets("Model").Select
Range("H8").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
SolverReset
SolverOk SetCell:="$0$1", MaxMinVal:=3, ValueOf:="0", ByChange:="$H$7"
SolverSolve (True)
Range("H7").Select
Selection.Copy
Sheets("DataTable").Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Do
Sheets("DataTable").Select
ActiveCell.Offset(1, -2).Range("A1").Select
Selection.Copy
Sheets("Model").Select
Range("H13").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("DataTable").Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.Copy
Sheets("Model").Select
Range("H8").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
SolverReset
SolverOk SetCell:="$o$1", MaxMinVal:=3, ValueOf:="0", ByChange:="$H$7"
SolverSolve (True)
Range("H7").Select
Selection.Copy
Sheets("DataTable").Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Loop Until ActiveCell = "Stop"
End Sub



Basically SolverSolve by itself was the problem. Change it to "SolverSolve (True)" and it'll bypass the results dialog box.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,422
Messages
5,837,143
Members
430,478
Latest member
masoodb1358

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top