Automated Goal Seek Sporadically Hangs.....

mfer

New Member
Joined
Feb 7, 2013
Messages
13
I have some VBA code that cycles through scenarios for goal seek. Typically, I need to run hundreds or thousands in one fell swoop. Sometimes, the code works and get's through all 1000 of the scenarios without any problem. Sometimes it hangs after any number of scenarios. I can't definitively tell what is causing it to hang, but I think it has to do if there is a big difference between the previous scenario goal seek answer, and then the next potential answer. Does anyone have any ideas on why it might hang? Or setting to change, etc, so that it doesn't hang? (Note: I also have similar code using Solver, but it is way too slow, but also seems to hangs). Note: for all of the scenarios, there is ONLY one answer and if I do the goal seek for the problem scenario without the macro, it solves as expected.....

Ideas to help Goal Seek not hang. Setting(s)?

Sub GoalSeeker()
For Each cll In Range("M13")
For Each celle In Range("ScenarioRange")
Range("O31").Value = celle.Value
Range("H9").Value = cll.Value
Range("R31").GoalSeek Goal:=Range("L31"), ChangingCell:=Range("O31")
Cells(celle.Row, cll.Column).Value = Range("O31")
Cells(celle.Row, cll.Column + 1).Value = Range("N31")
Cells(celle.Row, cll.Column + 2).Value = Range("O31")
Cells(celle.Row, cll.Column + 3).Value = Range("Q31")
Next celle
Next cll
End Sub
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Watch MrExcel Video

Forum statistics

Threads
1,132,640
Messages
5,654,539
Members
418,139
Latest member
nimesh72

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