共用方式為


Slicers Object (Excel)

A collection of Slicer objects.

Version Information

Version Added: Excel 2010

Remarks

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

Example

Use the Slicers property 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"

請參閱

概念

Excel Object Model Reference

Slicers Object Members