I have several buttons on my Spreadsheet that use different macros to open details view using Slicer tables.
I'm having an issue that periodically the selections within the Slicer may change (weekly).
If a value doesn't exist within the slicer I get a runtime error and have to remove that selection or tweak the data to add bogus info.

I want to identify the single sliceritem as True and ALL OTHERS as false.

here is an example of the macro as it was created when I used the Record macro option:

Sub Button_details()
'
' Button_details Macro
'

With ActiveWorkbook.SlicerCaches("Slicer_Program")
.SlicerItems("ABC").Selected = False
.SlicerItems("CBA").Selected = False
.SlicerItems("XYZ").Selected = True
.SlicerItems("#N/A").Selected = False
.SlicerItems("(blank)").Selected = False
End With
With ActiveWorkbook.SlicerCaches("Slicer_Program2")
.SlicerItems("ABC").Selected = False

.SlicerItems("XYZ").Selected = True
.SlicerItems("CBA").Selected = False
.SlicerItems("#N/A").Selected = False
.SlicerItems("(blank)").Selected = False
End With


Thanks in advance for any ideas/input.