Bewerken

Delen via


PivotTable.DrillDown method (Excel)

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

Syntax

expression.DrillDown (PivotItem, PivotLine)

expression A variable that represents a PivotTable object.

Parameters

Name Required/Optional Data type Description
PivotItem Required PIVOTITEM The member from which the drill down 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.

Return value

VOID

Example

The following sample code demonstrates the DrillDown method as used on a PivotTable.

ActiveSheet.PivotTables("PivotTable1").DrillDown ActiveSheet.PivotTables( _
      "PivotTable1").PivotFields("[Customer].[Customer Geography].[Country]"). _
      PivotItems("[Customer].[Customer Geography].[Country].&[Australia]"), _
      ActiveSheet.PivotTables("PivotTable1").PivotRowAxis.PivotLines(1)

The following sample code demonstrates the DrillDown method as used on a PivotChart.

ActiveChart.PivotLayout.PivotTable.DrillDown ActiveChart.PivotLayout.PivotTable _
      .PivotFields("[Customer].[Customer Geography].[Country]").PivotItems( _
      "[Customer].[Customer Geography].[Country].&[Australia]"), ActiveChart. _
      PivotLayout.PivotTable.PivotRowAxis.PivotLines(1)

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.