Uzma Shaheen
Active Member
- Joined
- Nov 10, 2012
- Messages
- 484
- Office Version
- 365
- 2021
- Platform
- Windows
- Mobile
- Web
Hi All
I have this code that clears all slicer filters on my sheet
How can i clear all the slicer filters except for the slicer called type?
I have this code that clears all slicer filters on my sheet
How can i clear all the slicer filters except for the slicer called type?
Code:
Sub SlicerReset()
Dim slcr As SlicerCache
Dim slc As Slicer
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
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
DoEvents
Exit For
End If
End If
Next slc
Next slcr
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
ActiveWorkbook.RefreshAll
End Sub