SlicerCache.CrossFilterType (Excel)

Returns or sets whether a slicer is participating in cross filtering with other slicers that share the same slicer cache, and how cross filtering is displayed.

xlSlicerCrossFilterHideButtonsWithNoData - Cross filtering is turned on for this slicer cache, any tile with no data for a filtering selection in other slicers connected to the same data source will be dimmed. Additionally, buttons will be hidden, xlSlicerCrossFilterShowItemsWithDataAtTop - Cross filtering is turned on for this slicer cache, any tile with no data for a filtering selection in other slicers connected to the same data source will be dimmed. Additionally, tiles with data are moved to the top in the slicer. , xlSlicerCrossFilterShowItemsWithNoData - Cross filtering is turned on for this slicer cache, any tile with no data for a filtering selection in other slicers connected to the same data source will be dimmed, xlSlicerNoCrossFilter - Cross filtering is turned off entirely, so all tiles are displayed and active (not dimmed) regardless of filtering selections in other slicers.

If more than one slicer is associated with the same PivotTable, by default, if the item or items that you filter by in one slicer have no corresponding data in another slicer, those items will be grayed out. For example, if you have a Country slicer and a State slicer, and you choose a country in the Country slicer, all states that are not in that country will be grayed out. This feature is referred to as cross filtering. The user interface settings that correspond to the setting of the CrossFilterType property are the Visually indicate items with no data and Show items with no data last check boxes in the Slicer Settings dialog box. Setting the CrossFilterType property to xlSlicerCrossFilterShowItemsWithDataAtTop corresponds to selecting both the Visually indicate items with no data and Show items with no data last check boxes. Setting the CrossFilterType property to xlSlicerCrossFilterShowItemsWithNoData corresponds to selecting only the Visually indicate items with no data check box. Clearing both check boxes corresponds to setting the CrossFilterType property to xlSlicerNoCrossFilter. OLAP data sources (SlicerCache.OLAP = True) are not supported by the CrossFilterType property. For OLAP data sources, use the CrossFilterType property of the SlicerCacheLevel object instead.

ActiveWorkbook.SlicerCaches(1).CrossFilterType = xlSlicerCrossFilterHideButtonsWithNoData
SlicerCache.CrossFilterType procedure builder