Hi everyone!
I use this to show many kind of information in a warehouse.. but it stops somehow from time to time. Please help me find the problem! Thank you!
I need to run this 24/7 on dedicated order displays.
Option Explicit
Const s1 As String = "display B"
Const s2 As String = "line delivery"
Dim dtRun As Date
Dim dtInterval As Date
Dim dtEndTime As Date
Sub SwapSheets()
'run this to start swapping sheets
dtInterval = TimeSerial(0, 0, 15) 'sets the frequency of swapping sheets
dtRun = Now() + dtInterval
If ActiveSheet.Name = s1 Then
Worksheets(s2).Activate
Else
Worksheets(s1).Activate
End If
Application.OnTime dtRun, "SwapSheets", dtEndTime, True
End Sub
Sub StopSwap()
'run this to manually stop sheets swapping
On Error Resume Next
Application.OnTime dtRun, "SwapSheets", dtEndTime, False
End Sub
Bookmarks