I am using this VBA code to refresh my entire workbook at specific time intervals.
As you can see, it is currently set to refresh every 60 minutes.
The code works great, however there’s one thing I wish it could also do:
1. Any time the sheet is opened, and/or
2. Any time this VBA code executes the sheet refresh process
I would like the AutoFilter to be "Cleared" (not disabled or turned off) as in the screen grab below:
Thanks in advance for any assistance.
Cheers
As you can see, it is currently set to refresh every 60 minutes.
Code:
Public RunWhen As Double
Public Const cRunIntervalMinutes = 60
Public Const cRunWhat = "Workbook_RefreshAll"
Sub StartTimer()
RunWhen = Now + TimeSerial(0, cRunIntervalMinutes, 0)
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, _
schedule:=True
End Sub
Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedure:=cRunWhat, schedule:=False
End Sub
Sub Workbook_RefreshAll()
Application.CalculateFullRebuild
ActiveWorkbook.RefreshAll
Call StartTimer
End Sub
The code works great, however there’s one thing I wish it could also do:
1. Any time the sheet is opened, and/or
2. Any time this VBA code executes the sheet refresh process
I would like the AutoFilter to be "Cleared" (not disabled or turned off) as in the screen grab below:
Thanks in advance for any assistance.
Cheers