Hi All, after a bit of help to reduce the number of lines of code due to getting a procedure too large error. I have a slicer that has say approx 70 selectable options. The code basically says when a cell = something then select this slicer, however the code each time is 70 lines long as it states the one you require as true then the rest listed as false. Please see below code, how can I shrink this????
ElseIf Sheets("Dashboard").Range("N3") = "This is Test Code" Then
Sheets("Dashboard").Select
With ActiveWorkbook.SlicerCaches("Slicer_Supplier")
.SlicerItems("This is Test Code").Selected = True
.SlicerItems("#N/A").Selected = False
.SlicerItems("Blah Blah").Selected = False
.SlicerItems("Blah Blah").Selected = False
.SlicerItems("Blah Blah").Selected = False
.SlicerItems("Blah Blah").Selected = False
.SlicerItems("Blah Blah").Selected = False
and so on.........
Any help greatly appreciated
ElseIf Sheets("Dashboard").Range("N3") = "This is Test Code" Then
Sheets("Dashboard").Select
With ActiveWorkbook.SlicerCaches("Slicer_Supplier")
.SlicerItems("This is Test Code").Selected = True
.SlicerItems("#N/A").Selected = False
.SlicerItems("Blah Blah").Selected = False
.SlicerItems("Blah Blah").Selected = False
.SlicerItems("Blah Blah").Selected = False
.SlicerItems("Blah Blah").Selected = False
.SlicerItems("Blah Blah").Selected = False
and so on.........
Any help greatly appreciated