Code:
Dim timer_enabled As Boolean
Dim timer_interval As Double
Sub cmd_TimerOn()
Dim interval As Double
interval = InputBox("intervall in sec", , 5) / 3600 / 24
Call VollBildAllesAus
Call timer_Start(interval)
End SubSub cmd_TimerOff()
Call StandardAnsicht
Call timer_Stop
End Sub
Sub Timer()
sheetCount = Sheetnr(ActiveSheet.Name)
'MsgBox Worksheets(sheetCount).Name
If sheetCount < 3 Then
Worksheets(Worksheets(sheetCount + 1).Name).Activate
Else
Worksheets(Worksheets(1).Name).Activate
End If
End Sub
Sub timer_OnTimer()
Call Timer
If timer_enabled Then Call timer_Start
End Sub
Sub timer_Start(Optional ByVal interval As Double)
If interval > 0 Then timer_interval = interval
timer_enabled = True
If timer_interval > 0 Then Application.OnTime (Now + timer_interval), "Timer_OnTimer"
End Sub
Sub timer_Stop()
timer_enabled = False
End Sub
Function Sheetnr(Shtnm As String)
For i = 1 To ActiveWorkbook.Sheets.Count
If Sheets(i).Name = Shtnm Then
Sheetnr = i
Exit Function
End If
Next i
Sheetnr = ""
End Function