I have a set of slicers that I need to clear, excluding 2 slicers which need to remain as whatever is selected. The code I am currently using allows me to exclude 1 of the slicers from the clear, but I cannot find the correct way to exclude the 2nd slicer. The code below is what I'm using:
Sub Clearslcr()
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, "Measure") = False Then
Slcr.ClearManualFilter
End If
End If
Next SL
Next Slcr
End Sub
Can anybody please advise how to make it exclude both? I'm trying to exclude "Measure" and "Current vs Comparison", seem to be able to do one or the other! (New to using VBA so learning as I go!)