neverending loop

Al Chara

MrExcel MVP
Joined
Feb 21, 2002
Messages
1,701
Does anyone ever catch themselves in a loop that never ends and displays a msgbox. If so, are there any keystrokes to exit out that override the msgbox "ok".

For example:
do while [a1].value=[a1].value
msgbox "I am stuck"
loop

Don't run the code, but is there a way to get out of the loop once it has started without Ctrl+Alt+Del?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
On 2002-04-09 13:05, Al Chara wrote:
Does anyone ever catch themselves in a loop that never ends and displays a msgbox. If so, are there any keystrokes to exit out that override the msgbox "ok".

Of course not! :wink:

If I ever found myself in such a position then I would hit CTRL+Break (or Pause/Break whatever you want to call it). Not that I would ever generate such a situation for myself. :biggrin: Never!

And I would never not save a workbook before testing such a macro and then CTRL+ALT+DEL to kill Excel and lose a day's work.
_________________<font color = green> Mark O'Brien
This message was edited by Mark O'Brien on 2002-04-09 13:10
 
Upvote 0
Hi Al,

I just ran the loop and broke out of it with

Ctrl+Break
(the key to the right of the scroll lock key)

Excel97 on NT4

Will check to see if you put an On Error Resume Next statement it will allow you to break out of the code.

Regards,
Jay

Update: On Error Resume Next has no effect. Ctrl-Break interrupts the code.
This message was edited by Jay Petrulis on 2002-04-09 13:12
 
Upvote 0
Ctrl+Break, its so simple. I must have hit ctrl+every other key on the darn keyboard. Thanks guys. I could kick myself for everytime that I had lost hours of work, when I had accidently put <> instead of = or vice versa.
 
Upvote 0
ctrl+break is not working for me! i have a messagebox up and anything i type in it keeps me stuck in the loop. whoops!
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,213
Members
448,554
Latest member
Gleisner2

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