VerticalAlignment Property

Microsoft Excel Visual Basic

VerticalAlignment Property

       

VerticalAlignment property as it applies to the Style and TextFrame objects.

Returns or sets the vertical alignment of the specified object. Read/write XlVAlign.

XlVAlign can be one of these XlVAlign constants.
xlVAlignCenter
xlVAlignJustify
xlVAlignBottom
xlVAlignDistributed
xlVAlignTop

expression.VerticalAlignment

expression   Required. An expression that returns one of the above objects.

Remarks

Some of these constants may not be available to you, depending on the language support (U.S. English, for example) that you've selected or installed.

VerticalAlignment property as it applies to the AxisTitle, CellFormat, ChartTitle, DataLabel, DataLabels, DisplayUnitLabel, and Range objects.

Returns or sets the vertical alignment of the specified object. Read/write Variant.

expression.VerticalAlignment

expression   Required. An expression that returns one of the above objects.

Example

As it applies to the CellFormat object.

This example sets the height of row 2 on Sheet1 to twice the standard height and then centers the contents of the row vertically.

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