![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
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? |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
Quote:
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. 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. _________________ [b] Mark O'Brien [ This Message was edited by: Mark O'Brien on 2002-04-09 13:10 ] |
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
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 ] |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
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.
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2006
Posts: 69
|
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!
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Mar 2006
Posts: 69
|
ok it worked. i don't know what i did but it broke. wooohoo!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|