Edit

Share via


Slicers object (Excel)

A collection of Slicer objects.

Remarks

Each Slicer object represents a slicer in a workbook. Slicers are used to filter data.

Example

Use the Slicers property of the SlicerCache object to return the Slicers collection. The following code example displays the number of slicers in the first slicer cache in the workbook.

MsgBox ActiveWorkbook.SlicerCaches(1).Slicers.Count

Use Slicers (index), where index is the slicer index number or name, to return a single Slicer object from the slicers collection. The following code example changes the caption for the first slicer in the first slicer cache to My Slicer.

ActiveWorkbook.SlicerCaches(1).Slicers(1).Caption = "My Slicer"

Methods

Properties

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.