Skip to content

Latest commit

 

History

History
46 lines (27 loc) · 1.05 KB

Excel.PivotTable.DataPivotField.md

File metadata and controls

46 lines (27 loc) · 1.05 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PivotTable.DataPivotField property (Excel)
vbaxl10.chm235140
vbaxl10.chm235140
Excel.PivotTable.DataPivotField
00b62ffd-76bd-cd4b-218c-b6d695150efb
05/08/2019
medium

PivotTable.DataPivotField property (Excel)

Returns a PivotField object that represents all the data fields in a PivotTable. Read-only.

Syntax

expression.DataPivotField

expression A variable that represents a PivotTable object.

Example

This example moves the second PivotItem object to the first position. It assumes that a PivotTable exists on the active worksheet and that the PivotTable contains data fields.

Sub UseDataPivotField() 
 
 Dim pvtTable As PivotTable 
 
 Set pvtTable = ActiveSheet.PivotTables(1) 
 
 ' Move second PivotItem to the first position in PivotTable. 
 pvtTable.DataPivotField.PivotItems(2).Position = 1 
 
End Sub

[!includeSupport and feedback]