LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Stopping Code from Running whilst in Loop...

Hi,

I'm performing a series of operations on cells within the used range of a
s/sheet. A summary of the code is as follows:

Dim c as range

on error goto errhandler
Application.EnableCancelKey = xlErrorHandler

For Each c In ActiveSheet.UsedRange

.....series of operations on each cell....

next c

exit sub

errhandler:

end sub

I'd like to give the user the option of breaking out of the loop using the
escape key. However the code stubbornly refuses to do this in practice...
I've tried using "doevents" without any luck - although I'm not sure that
I'm applying it correctly.

Suggestions....

Rgds....Chris




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax for stopping a Do Loop? bondjel Excel Discussion (Misc queries) 5 March 22nd 10 01:35 PM
Status bar (or similar) to appear whilst running a long macro Ant Excel Discussion (Misc queries) 8 November 11th 05 09:21 AM
How do I pause a Macro whilst it is running? Gary[_20_] Excel Programming 4 August 26th 04 01:08 AM
How to Mute/Enable Windows Sounds whilst running VBA code Hotbird[_3_] Excel Programming 0 July 29th 04 04:43 PM
How to Mute/Enable Windows Sounds whilst running VBA code Hotbird[_3_] Excel Programming 0 July 20th 04 09:34 PM


All times are GMT +1. The time now is 01:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"