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

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,214,614
Messages
6,120,520
Members
448,968
Latest member
Ajax40

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
Back
Top