Hi,

Im trying to develop a macro that limits the selection on a pivot table slicer to only one item at a time (so that people can't pick more than one thing at once by selecting the ctrl or shift keys) currently what I have is the following:

Sub OneItemSlicer(Slicername As String, Item As String)

Dim slItem As SlicerItem

With ActiveWorkbook.SlicerCaches(Slicername)
.Sliceritems(Item).Selected = True
For Each slItem In .VisibleSlicerItems
If slItem.Name <> .Sliceritems(Item).Name Then
slItem.Selected = False
End If
Next slItem
End With
End Sub

This macro works, however, it requires an action button, and the button can only be used for one of the items in the slicer. therefore I would need to have a separate action button for every item in the slicer.

Is there a way to program the slicer directly? that way the action button wont be needed?

thanks everyone