Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 1.51 KB

Excel.PivotField.Orientation.md

File metadata and controls

57 lines (38 loc) · 1.51 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PivotField.Orientation property (Excel)
vbaxl10.chm240087
vbaxl10.chm240087
Excel.PivotField.Orientation
1b3e0867-3a44-a908-ef1b-90ab21653ab9
05/07/2019
medium

PivotField.Orientation property (Excel)

Returns or sets an XlPivotFieldOrientation value that represents the location of the field in the specified PivotTable report.

Syntax

expression.Orientation

expression A variable that represents a PivotField object.

Remarks

For OLAP data sources, setting this property for one field in a hierarchy sets the orientation for the other fields in the same hierarchy. Dimension fields can only be oriented in the row, column, and page field areas of the PivotTable report. Measure fields can only be oriented in the data area.

Setting a hierarchy or data field to xlHidden removes the hierarchy or field from the PivotTable report.

Example

This example displays the orientation for the ORDER_DATE field.

Set pvtTable = Worksheets("Sheet1").Range("A3").PivotTable 
Set pvtField = pvtTable.PivotFields("ORDER_DATE") 
Select Case pvtField.Orientation 
 Case xlHidden 
 MsgBox "Hidden field" 
 Case xlRowField 
 MsgBox "Row field" 
 Case xlColumnField 
 MsgBox "Column field" 
 Case xlPageField 
 MsgBox "Page field" 
 Case xlDataField 
 MsgBox "Data field" 
End Select

[!includeSupport and feedback]