Hi,
You can use Excel's VBA function to do this job.
Go to Tools > Macro > Visual Basic Editor
Go to View > Project Explorer
Right clck on the bold name of your workbook and insert Module
Copy and paste the following code in blank module:
Public Const TimerTest = "ActionSub" 'call the sub routine with sheet tab
Dim SheetNo As Integer
Sub TimerStart()
Dim RunTime As Double
RunTime = Now + TimeSerial(0, 0, 10) ' Wait 10 secs
Application.OnTime EarliestTime:=RunTime, Procedure:=TimerTest, Schedule:=True 'Start sub
End Sub
Sub TimerStop()
On Error Resume Next
Application.OnTime EarliestTime:=RunTime, Procedure:=TimerTest, Schedule:=False 'stop sub
End Sub
Sub ActionSub()
'This contains the code to tab sheets
Select Case SheetNo ' Change sheet
Case 0
Sheet2.Activate
SheetNo = 3
Case 1
Sheet1.Activate
SheetNo = 2
Case 2
Sheet2.Activate
SheetNo = 3
Case 3
Sheet3.Activate
SheetNo = 1
Case Else
Sheet1.Activate
SheetNo = 2
End Select
Call TimerStart ' RESTART 10 SEC WAIT
End Sub
To start the timer go to tools > Macro > Macro and run TimerStart, to stop run TimerStop. The actual event of tabbing sheets is in ActionSub section.
Hope this is what you are looking for.
Cheers
John
|