VerticalAlignment Property

Applies To

AxisTitle Object, Button Object, Buttons Collection, ChartTitle Object, DataLabel Object, DataLabels Collection, DrawingObjects Collection, GroupObject Object, GroupObjects Collection, Range Object, Style Object, TextBox Object, TextBoxes Collection.

Description

Returns or sets the vertical alignment of the object (can be one of xlBottom, xlCenter, xlDistributed, xlJustify, or xlTop). Read-write.

Remarks

The xlDistributed alignment style works only in Far East versions of Microsoft Excel.

See Also

AddIndent Property, HorizontalAlignment Property.

Example

This example sets the height of row two on Sheet1 to twice the standard height and then centers the vertical alignment.


Worksheets("Sheet1").Rows(2).RowHeight = _
    2 * Worksheets("Sheet1").StandardHeight
Worksheets("Sheet1").Rows(2).VerticalAlignment = xlCenter