Horizontal Alignment Property

The HorizontalAlignment property returns or sets the horizontal alignment of all cells in the range. The value can be one of the following constants:

Enum XlHAlign xlHAlignRight = -4152 xlHAlignLeft = -4131 xlHAlignJustify = -4130

xlHAlignDistributed = -4117 'for Far East Excel xlHAlignCenter = -4108 xlHAlignGeneral = 1 xlHAlignFill = 5

xlHAlignCenterAcrossSelection = 7 End Enum

Note especially the xlHAlignCenterAcrossSelection constant, which is very useful for aligning a title across multiple cells.

+1 -1

Post a comment