Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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
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
timed events H1 Excel Worksheet Functions 2 September 11th 08 01:54 PM
Timed Message Box FARAZ QURESHI Excel Discussion (Misc queries) 3 January 26th 07 03:13 PM
TIMED MSGBOX FARAZ QURESHI Excel Discussion (Misc queries) 6 January 3rd 07 08:24 PM
timed macro Decreenisi Excel Worksheet Functions 3 March 3rd 06 12:33 PM
timed macro alan_bourne[_21_] Excel Programming 3 November 26th 03 11:44 AM


All times are GMT +1. The time now is 07:49 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"