Skip to content

Latest commit

 

History

History
81 lines (55 loc) · 2.83 KB

Excel.pivottable.drillup.md

File metadata and controls

81 lines (55 loc) · 2.83 KB
title keywords f1_keywords ms.assetid ms.date ms.localizationpriority
PivotTable.DrillUp method (Excel)
vbaxl10.chm235207
vbaxl10.chm235207
18933878-53c5-ef64-afe7-919b0a1564f8
05/08/2019
medium

PivotTable.DrillUp method (Excel)

Enables you to drill up into the data within an OLAP-based or PowerPivot-based cube hierarchy.

Syntax

expression.DrillUp (PivotItem, PivotLine, LevelUniqueName)

expression A variable that represents a PivotTable object.

Parameters

Name Required/Optional Data type Description
PivotItem Required PIVOTITEM The member from which the drill up is performed.
PivotLine Optional Variant Specifies the line in the PivotTable where the operation starting member resides. In cases where PivotLine is not specified, defaults to the top PivotLine where the member appears.
LevelUniqueName Optional Variant The target for a multi-level drill up. The default action, if not specified, is a one level drill up.

Return value

VOID

Example

The following sample code demonstrates a single-level drill up on a PivotTable.

ActiveSheet.PivotTables("PivotTable1").DrillUp ActiveSheet.PivotTables( _
      "PivotTable1").PivotFields("[Customer].[Customer Geography].[Postal Code]"). _
      PivotItems( _
      "[Customer].[Customer Geography].[Postal Code].&[2450]&[Coffs Harbour]"), _
      ActiveSheet.PivotTables("PivotTable1").PivotRowAxis.PivotLines(1)

The following sample code demonstrates a level drill up on a PivotChart.

ActiveChart.PivotLayout.PivotTable.DrillUp ActiveChart.PivotLayout.PivotTable. _
      PivotFields("[Customer].[Customer Geography].[Postal Code]").PivotItems( _
      "[Customer].[Customer Geography].[Postal Code].&[2450]&[Coffs Harbour]"), _
      ActiveChart.PivotLayout.PivotTable.PivotRowAxis.PivotLines(1)

The following sample code demonstrates a multi-level drill up on a PivotTable.

ActiveSheet.PivotTables("PivotTable1").DrillUp ActiveSheet.PivotTables( _
     "PivotTable1").PivotFields("[Customer].[Customer Geography].[City]").PivotItems _
     ("[Customer].[Customer Geography].[City].&[Coffs Harbour]&[NSW]"), ActiveSheet. _
     PivotTables("PivotTable1").PivotRowAxis.PivotLines(1), _
     "[Customer].[Customer Geography].[Country]"

The following sample code demonstrates a multi-level drill up on a PivotChart.

ActiveChart.PivotLayout.PivotTable.DrillUp ActiveChart.PivotLayout.PivotTable. _
     PivotFields("[Customer].[Customer Geography].[Postal Code]").PivotItems( _
     "[Customer].[Customer Geography].[Postal Code].&[2450]&[Coffs Harbour]"), _
     ActiveChart.PivotLayout.PivotTable.PivotRowAxis.PivotLines(1) , _
     "[Customer].[Customer Geography].[Country]"

[!includeSupport and feedback]