constant.
XlHAlign can be one of these XlHAlign constants. |
xlHAlignGeneral |
xlHAlignCenter |
xlHAlignLeft |
xlHAlignRight |
expression.HorizontalAlignment
expression Required. An expression that returns a Range object.
Example
This example left-aligns the range A1:A5 on Sheet1.
Sub AlignRange()
Dim ssConstants
Set ssConstants = Spreadsheet1.Constants
Worksheets("Sheet1").Range("A1:A5").HorizontalAlignment = ssConstants.xlHAlignLeft
End Sub