Greetings, is it possible to make a slicer object size based on the number of selections available?
I have this -
I was hoping I could set the size to automatically adjust based on the content, like
I have this -
VBA Code:
Sub SLICER()
ActiveWorkbook.SlicerCaches.Add2(ActiveSheet.ListObjects("Table1"), "Area").Slicers.add ActiveSheet, , "Area", "Area", 1, 600, 150, 150
With ActiveWorkbook.SlicerCaches("Slicer_Area").Slicers("Area")
.Caption = "Area"
.DisplayHeader = True
.SlicerCache.CrossFilterType = xlSlicerCrossFilterHideButtonsWithNoData
.SlicerCache.SortItems = xlSlicerSortAscending
.SlicerCache.SortUsingCustomLists = True
End With
End Sub
I was hoping I could set the size to automatically adjust based on the content, like
"Area", "Area", 1, 600, , ,
- basically not declaring values for the width and height.