Reputation: 21
ActiveWorkbook.SlicerCaches("Slicer_xxxxx").ClearManualFilter
I need to deselect all slicer items. I tried this
For i = 1 To numberOfItems
On Error Resume Next
.SlicerItems(i).Selected = False
Next i
Please help
Upvotes: 2
Views: 16684
Reputation: 61
Public Sub unselectAllBut(slicerName As String, newSelection As String)
ThisWorkbook.SlicerCaches(slicerName).SlicerItems(newSelection).Selected = True
Dim slc As SlicerItem
For Each slc In ThisWorkbook.SlicerCaches(slicerName).SlicerItems
If Not slc.Caption = newSelection Then
slc.Selected = False
End If
Next slc
End Sub
Try this! :)
Ex: unselectAllBut(UrSlicerName, Item's caption u want to select)
Upvotes: 6