Reputation: 21
I have a very simple VBA code where I want to first clear all filters in the slicer then select RB.
Below is the code I am using without success:
ActiveWorkbook.SlicerCaches("Slicer_Manufacturer1").ClearManualFilter
With ActiveWorkbook.SlicerCaches("Slicer_Manufacturer1")
.SlicerItems("RB").Selected = True
End With
End Sub
Can anyone help?
Upvotes: 0
Views: 5664
Reputation: 549
Try this and let me know what happens:
Dim cache As SlicerCache
For Each cache In ActiveWorkbook.SlicerCaches
cache.ClearManualFilter
Next cache
With ActiveWorkbook.SlicerCaches("Slicer_Manufacturer1")
.SlicerItems("RB").Selected = True
End With
End Sub
Upvotes: 1