VerticalAlignment Property [Excel 2003 VBA Language Reference]
VerticalAlignment property as it applies to the Style and TextFrame objects.
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. 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
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
Applies to | AxisTitle Object | CellFormat Object | ChartTitle Object | DataLabel Object | DataLabels Collection Object | DisplayUnitLabel Object | Range Collection | Style Object | TextFrame Object
See Also | AddIndent Property | HorizontalAlignment Property