HorizontalAlignment Property

Microsoft Office Web Components Visual Basic

constant.

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