PivotItem 对象 (Excel)PivotItem object (Excel)

代表数据透视表字段中的项目。Represents an item in a PivotTable field.


这些项目是某个字段类型中的各个数据项。The items are the individual data entries in a field category. PivotItem 对象是 PivotItems 集合的成员。The PivotItem object is a member of the PivotItems collection. PivotItems 集合包含某个 PivotField 对象中所有的项目。The PivotItems collection contains all the items in a PivotField object.


使用**PivotItems** (索引), 其中_索引_是项索引号或名称, 返回单个PivotItem对象。Use PivotItems (index), where index is the item index number or name, to return a single PivotItem object.

下例隐藏“Sheet3”上第一张数据透视表中“Year”字段中包含“1998”的所有数据项。The following example hides all entries in the first PivotTable report on Sheet3 that contain "1998" in the Year field.

Worksheets("sheet3").PivotTables(1) _ 
 .PivotFields("year").PivotItems("1998").Visible = False



另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.