Hi,
Am currently the code below to Reset Slicers on a worksheet and it works fine but takes too long (30sec+). Quicker to do it manually.
Is there any way to optimize code to run faster??
Appreciate any help
Private Sub ClearAllSlicers_Click()
Dim slcr As SlicerCache
Dim sl As Slicer
For Each slcr In ActiveWorkbook.SlicerCaches
For Each sl In slcr.Slicers
If sl.Parent.Name = ActiveSheet.Name Then
If InStr(sl.Name, "FILTER DATE") = False Then
slcr.ClearManualFilter
End If
End If
Next sl
Next slcr
End Sub
Am currently the code below to Reset Slicers on a worksheet and it works fine but takes too long (30sec+). Quicker to do it manually.
Is there any way to optimize code to run faster??
Appreciate any help

Private Sub ClearAllSlicers_Click()
Dim slcr As SlicerCache
Dim sl As Slicer
For Each slcr In ActiveWorkbook.SlicerCaches
For Each sl In slcr.Slicers
If sl.Parent.Name = ActiveSheet.Name Then
If InStr(sl.Name, "FILTER DATE") = False Then
slcr.ClearManualFilter
End If
End If
Next sl
Next slcr
End Sub