Class SlicerItem (Excel VBA)

The class SlicerItem represents an item in a slicer.

Set

To use a SlicerItem class variable it first needs to be instantiated, for example

Dim strIndex As String: strIndex = 
Dim slc As SlicerCache: Set slc = 
Dim slciteSlicerItem As SlicerItem
Set slciteSlicerItem = slc.SlicerItems(Index:=strIndex)

The following procedures can be used to set variables of type SlicerItem: Slicer.ActiveItem, SlicerItems.Item, SlicerCache.SlicerItems, SlicerCache.VisibleSlicerItems and SlicerCacheLevel.SlicerItems

For Each

Here is an example of processing the SlicerItem items in a collection.

Dim slc As SlicerCache: Set slc = 
Dim slciteSlicerItem As SlicerItem
For Each slciteSlicerItem In slc.SlicerItems
	
Next slciteSlicerItem

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Name with its procedures SourceName and SourceNameStandard

Properties

Caption returns the label text for the slicer item.

HasData returns whether the slicer item contains data that matches the current manual filter state.

Name returns the name of the slicer item.

Parent returns the parent SlicerCache object for the slicer item.

Selected returns or sets whether the slicer item is selected. Read/write for slicers connected to non-OLAP data sources.

Value returns the value of the slicer item.

SlicerItems.Count returns the number of objects in the collection.

SlicerItems.Item returns a SlicerItem object from a collection.

SlicerItems.Parent returns the parent SlicerCache object for the specified object. Read-only.