Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Timed Tab Rotation in one Workbook
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Timed Tab Rotation in one Workbook
Perfect, thanks Frank!
Tyson "Frank Kabel" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
timed events | Excel Worksheet Functions | |||
Timed Message Box | Excel Discussion (Misc queries) | |||
TIMED MSGBOX | Excel Discussion (Misc queries) | |||
timed macro | Excel Worksheet Functions | |||
timed macro | Excel Programming |