Export (0) Print
Expand All

VerticalAlignment Property [Excel 2003 VBA Language Reference]

Office 2003

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.

Returns or sets the vertical alignment of the specified object. One of the following read/write Variant values:

xlBottom
xlCenter
xlDistributed
xlJustify
xlTop

expression.VerticalAlignment

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

Example

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

				


See Also | AddIndent Property | HorizontalAlignment Property


Show:
© 2014 Microsoft