Justify Method

Applies To

Range Object.

Description

Rearranges the text in a range so that it fills the range evenly.

Syntax

object.Justify

object

Required. The range to justify.

Remarks

If the range is not large enough, Microsoft Excel displays a message that text will extend below the range. If you choose the OK button, justified text will replace the contents in cells extending beyond the selected range. To prevent this message from appearing, set the DisplayAlerts property to False, in which case the text will always replace the contents in cells below the range.

Example

This example justifies text in cell A1 on Sheet1.


Worksheets("Sheet1").Range("A1").Justify