Orientation Property

Applies To

AxisTitle object, ChartTitle object, DataLabel object, DataLabels collection object, PageSetup object, PivotField object, Range object, Style object, TextFrame object, TickLabels object.

Description

Returns or sets the object's orientation, as shown in the following table. Read/write Long.

Object

Orientation

ChartObject, ChartObjects

Embedded chart placement. Can be one of the following XlPlacement constants: xlFreeFloating, xlMove, or xlMoveAndSize.

PageSetup

Portrait or landscape printing mode. Can be either of the following XlPageOrientation constants: xlLandscape or xlPortrait.

PivotField

The location of the field in the PivotTable. Can be one of the following XlPivotFieldOrientation constants: xlColumnField, xlDataField, xlHidden, xlPageField, or xlRowField.

AxisTitle, ChartTitle, DataLabel, Range, Style, TextFrame

The text orientation. Can be an integer value from  – 90 to 90 degrees or one of the following XlOrientation constants: xlDownward, xlHorizontal, xlUpward, or xlVertical.

TickLabels

The text orientation. Can be an integer value from  – 90 to 90 degrees or one of the following XlTickLabelOrientation constants: xlTickLabelOrientationAutomatic, xlTickLabelOrientationDownward, xlTickLabelOrientationHorizontal, xlTickLabelOrientationUpward, or xlTickLabelOrientationVertical.


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
This example sets Sheet1 to be printed in landscape orientation.

Worksheets("Sheet1").PageSetup.Orientation = xlLandscape