View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Timed Tab Rotation in one Workbook

Hi Thysone
try the following:
1. Put the following in one of your workbook modules:

Dim Nexttime
Sub Toggle_sheets()
Dim i
Nexttime = Now + TimeValue("00:00:15")
i = ActiveSheet.Index + 1
If i 4 Then i = 1
ActiveWorkbook.Worksheets(i).Activate
Application.OnTime Nexttime, "Toggle_sheets"
End Sub

Sub StopIt()
Application.OnTime Nexttime, "Toggle_sheets", schedule:=False
ActiveWorkbook.Worksheets(1).Activate
End Sub

2. You can start the toggling with the first macro. The second one
stops it.

Note: You won't be able to do anything meaningful while this macro
runs!
--
Regards
Frank Kabel
Frankfurt, Germany

Tysone wrote:
OK, here is what I'm trying to do. I have four tabs (Books, Coffee,
Shoes, Candy) in my workbook and what I want Excel to just flip
through each tab every 15 seconds. Is there a way to do this in a
macro?

Thanks

Tyson