Stuck in an infinite loop!!

zookeepertx

Well-known Member
Joined
May 27, 2011
Messages
589
Office Version
  1. 365
Platform
  1. Windows
I currently have a macro stuck in an infinite loop! I've done Alt/Esc about 3 times and it's not breaking out. I tried Ctrl/Esc, Alt/End and Ctrl/End & it isn't helping.

Anybody have any ideas?

Thank you!!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi Gallen,

Okay, I just tried that 3 times and it didn't seem to make any difference.
 
Upvote 0
I can't; the Visual Basic window is also "stuck" and won't let me highlight and copy the code.
 
Upvote 0
Sounds like you'll have to kill it via task manager.
 
Upvote 0
Failing that you will need to open task manager and end process. However you will lose any unsaved excel work.

Then you must find out why your code is in an infinite loop...

Can always post code here if you are unsure. I'm confident it's something we've all done at some point :D
 
Upvote 0
How many rows/columns are you looping through? & are you deleting anything during the loop?
 
Upvote 0
Hi Fluff

Yeah, I finally gave up a few minutes ago and went to Task Manager and took care of it.

I was running a code where lCol was being Dimmed (is that the right word for past-tense of Dim in VBA?) but that had already been done earlier in the macro, so it had failed. So, I went to change all of the lCol to Lc and apparently, I missed one. So, I assume that if seized up trying to loop through "From j to Lc". I can't be SURE that's where the problem was because VBA window didn't show a yellow highlight showing how far the code had gotten, but that was the only thing I changed and the macro was running fine before that. (Although I was trying to adjust it, because my co-worker changed his mind about what result he wanted.)

Anyway, I'm going to recreate the adjustments (correctly this time!!) and try it again here in a minute. Keeping my fingers crossed!

Thanks!

Jenny
 
Last edited:
Upvote 0
Hi Gallen,

See my post #9 .

If it fails again I'll post back with the code (which I'm going to copy right now and paste in a Word document, LOL!)

Thanks!

Jenny
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

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