Skip to content

Latest commit

 

History

History
48 lines (28 loc) · 1.19 KB

Excel.Range.Ungroup.md

File metadata and controls

48 lines (28 loc) · 1.19 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Range.Ungroup method (Excel)
vbaxl10.chm144212
vbaxl10.chm144212
Excel.Range.Ungroup
ac20c780-1a8e-2709-13c4-a6ca8220fb0a
05/11/2019
medium

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 A variable that represents a Range object.

Return value

Variant

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

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

[!includeSupport and feedback]