Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sheet cycle macro

I am trying to cycle through some sheets, but when you hit Esc the
sheets cycle quickly until Esc is hit again. I want the macro to end
with just on press of Esc. Any help would be great, thanks.


Sub CycleSheets()

Dim lIndex As Long

Application.EnableCancelKey = xlErrorHandler
On Error GoTo ErrorCleanUp

Do Until test = True
For lIndex = 1 To 3
Sheets(lIndex).Select
Application.Wait Time + TimeValue("00:00:02")
Next lIndex
Loop

ErrorCleanUp:
MsgBox "macro has been paused"
Exit Sub

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default sheet cycle macro

See response to your duplicate post in microsoft.public.excel.
--
Jim Cone
Portland, Oregon USA





"John S."
wrote in message
...
I am trying to cycle through some sheets, but when you hit Esc the
sheets cycle quickly until Esc is hit again. I want the macro to end
with just on press of Esc. Any help would be great, thanks.


Sub CycleSheets()

Dim lIndex As Long

Application.EnableCancelKey = xlErrorHandler
On Error GoTo ErrorCleanUp

Do Until test = True
For lIndex = 1 To 3
Sheets(lIndex).Select
Application.Wait Time + TimeValue("00:00:02")
Next lIndex
Loop

ErrorCleanUp:
MsgBox "macro has been paused"
Exit Sub

End Sub
Reply
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
Macro to cycle through worksheets tpmax Excel Programming 1 June 27th 07 07:56 PM
How do I keep result from 1 iteration cycle to use in next cycle? sgl8akm Excel Discussion (Misc queries) 0 July 27th 06 08:28 PM
vba code to cycle through each column in a sheet GJones Excel Programming 0 September 16th 04 07:54 PM
vba code to cycle through each column in a sheet Ron Rosenfeld Excel Programming 0 September 16th 04 07:52 PM
vba code to cycle through each column in a sheet David Excel Programming 0 September 16th 04 07:31 PM


All times are GMT +1. The time now is 03:57 AM.

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

About Us

"It's about Microsoft Excel"