区域。取消组合方法 (Excel)Range.Ungroup method (Excel)

在分级显示中对一个区域进行升级(即降低其分级显示的级别)。Promotes a range in an outline (that is, decreases its outline level). 指定区域必须是行或列,或者行区域或列区域。The specified range must be a row or column, or a range of rows or columns. 如果指定区域在数据透视表中,本方法将对该区域内的项取消分组。If the range is in a PivotTable report, this method ungroups the items contained in the range.

语法Syntax

表达式取消组合expression.Ungroup

expression 一个表示 Range 对象的变量。expression A variable that represents a Range object.

返回值Return value

VariantVariant

注解Remarks

如果当前单元格在父字段的字段标题中,则该字段中的所有分组将被取消,并且该字段从数据透视表中删除。If the active cell is in a field header of a parent field, all the groups in that field are ungrouped and the field is removed from the PivotTable report. 当父字段中的最后一个分组被取消后,整个字段将从数据透视表中删除。When the last group in a parent field is ungrouped, the entire field is removed from the report.

示例Example

此示例取消 ORDER_DATE 字段的分组。This example ungroups the ORDER_DATE field.

Set pvtTable = Worksheets("Sheet1").Range("A3").PivotTable 
Set groupRange = pvtTable.PivotFields("ORDER_DATE").DataRange 
groupRange.Cells(1).Ungroup

支持和反馈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.