Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |