HorizontalAlignment Property

Applies To

AxisTitle Object, Button Object, Buttons Collection, ChartTitle Object, DataLabel Object, DataLabels Collection, DrawingObjects Collection, GroupObject Object, GroupObjects Collection, Range Object, Style Object, TextBox Object, TextBoxes Collection.

Description

Returns or sets the horizontal alignment for the object. Can be one of xlCenter, xlDistributed, xlJustify, xlLeft, or xlRight for all objects. In addition, the Range or Style object can be set to xlCenterAcrossSelection, xlFill, or xlGeneral. Read-write.

Remarks

The xlDistributed alignment style works only in Far East versions of Microsoft Excel.

See Also

AddIndent Property, VerticalAlignment Property.

Example

This example applies left alignment to the range A1:A5 on Sheet1.


Worksheets("Sheet1").Range("A1:A5").HorizontalAlignment = xlLeft