Position Property

Applies To

DataLabel object, DataLabels collection object, Legend object, PivotField object, PivotItem object.

Description

Returns or sets the position of the specified object, as shown in the following table. Read/write Long.

Object

Position

DataLabel, DataLabels

Position of the data label. Can be one of the following XlDataLabelPosition constants: xlLabelPositionAbove, xlLabelPositionBelow, xlLabelPositionBestFit, xlLabelPositionCenter, xlLabelPositionCustom, xlLabelPositionInsideBase, xlLabelPositionInsideEnd, xlLabelPositionLeft, xlLabelPositionMixed, xlLabelPositionOutsideEnd, or xlLabelPositionRight.

Legend

Position of the legend on the chart. Can be one of the following XlLegendPosition constants: xlLegendPositionBottom, xlLegendPositionCorner, xlLegendPositionLeft, xlLegendPositionRight, or xlLegendPositionTop.

PivotField

Position of the field (first, second, third, and so on) among all the fields in its orientation (Rows, Columns, Pages, Data).

PivotItem

Position of the item in its field, if the item is currently showing.


Example

This example moves the chart legend to the bottom of the chart.

Charts(1).Legend.Position = xlLegendPositionBottom
This example displays the position number of the pivot item that contains the active cell.

Worksheets("Sheet1").Activate
MsgBox "The active item is in position number " & _
    ActiveCell.PivotItem.Position