Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to cycle through worksheets | Excel Programming | |||
How do I keep result from 1 iteration cycle to use in next cycle? | Excel Discussion (Misc queries) | |||
vba code to cycle through each column in a sheet | Excel Programming | |||
vba code to cycle through each column in a sheet | Excel Programming | |||
vba code to cycle through each column in a sheet | Excel Programming |