Skip to content

Latest commit

 

History

History
46 lines (22 loc) · 1.02 KB

ac34eb5b-be2f-a58c-484b-d53cc82afa81.md

File metadata and controls

46 lines (22 loc) · 1.02 KB

PivotCell.PivotTable Property (Excel)

Returns a PivotTable object that represents the PivotTable report associated with the PivotCell.

Syntax

expression . PivotTable

expression A variable that represents a PivotCell object.

Example

This example sets the current page for the PivotTable report on Sheet1 to the page named "Canada."

Set pvtTable = Worksheets("Sheet1").Range("A3").PivotTable 
pvtTable.PivotFields("Country").CurrentPage = "Canada"

This example determines the PivotTable report associated with the Sales chart on the active worksheet, and then it sets the page named "Oregon" as the current page for the PivotTable report.

Set objPT = _ 
 ActiveSheet.Charts("Sales").PivotLayout.PivotTable 
objPT.PivotFields("State").CurrentPageName = "Oregon"

See also

Concepts

PivotCell Object

Other resources

PivotCell Object Members