HorizontalAlignment Property

Applies To

AxisTitle object, ChartTitle object, DataLabel object, DataLabels collection object, Range object, Style object, TextFrame object.

Description

Returns or sets the horizontal alignment for the object. For all objects, this can be one of the following XlHAlign constants: xlHAlignCenter, xlHAlignDistributed, xlHAlignJustify, xlHAlignLeft, or xlHAlignRight. In addition, for the Range or Style object, this property can be set to xlHAlignCenterAcrossSelection, xlHAlignFill, or xlHAlignGeneral. Read/write Long.

Remarks

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

See Also

AddIndent property, VerticalAlignment property.

Example

This example left aligns the range A1:A5 on Sheet1.

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