Hi all, I am trying to clear all slicers and reset to default via VBS. With the below script I am able to reset all filters except any timeline filters on the same page. Any ideas?
Thanks so much!
Sub ClearSlicers()
Dim slcr As SlicerCache
Dim slc As Slicer
Application.ScreenUpdating = False
For Each slcr In ActiveWorkbook.SlicerCaches
For Each slc In slcr.Slicers
If slc.Shape.Parent Is ActiveSheet Then
If slcr.FilterCleared = False Then
slcr.ClearManualFilter
Exit For
End If
End If
Next slc
Next slcr
Application.ScreenUpdating = True
End Sub
Bookmarks