Share via


PivotField.CurrentPageList Property

Excel Developer Reference

Returns or sets an array of strings corresponding to the list of items included in a multiple-item page field of a PivotTable report. Read/write Variant.

Syntax

expression.CurrentPageList

expression   A variable that represents a PivotField object.

Remarks

To avoid run-time errors, the data source must be an OLAP source, the field chosen must currently be in the Page position, and the EnableMultiplePageItems property must be set to True.

Example

This example sets the page field to list the "Food" items of the PivotTable report. It assumes a PivotTable exists on the active worksheet.

Visual Basic for Applications
  Sub UseCurrentPageList()
Dim pvtTable As PivotTable
Dim pvtField As PivotField

Set pvtTable = ActiveSheet.PivotTables(1)
Set pvtField = pvtTable.PivotFields("[Product]")

' To avoid run-time errors set the following property to True.
pvtTable.CubeFields("[Product]").EnableMultiplePageItems = True

' Set the page list to "Food".
pvtField.<strong>CurrentPageList</strong> = "[Product].[All Products].[Food]"

End Sub

See Also