Option Explicit
Public bTimerOn As Boolean
Sub ToggleTimer() ' This Sub will switch the automatic timer on if it was off before, and vice-versa
bTimerOn = Not bTimerOn
Refresh ' It calls the Refresh Sub
End Sub
Sub Refresh() ' This Sub calculates the sheet and tells Excel to call it again after 1 second
Application.Calculate
If bTimerOn Then ' If bTimerOn is True, start refreshing automatically
Application.OnTime Now + TimeValue("00:00:01"), "Refresh" ' The intervall is set to 1 second but can be changed variably
End If
End Sub