ShapeRange.Align Method (Excel)

Aligns the shapes in the specified range of shapes.

expression .Align(AlignCmd, RelativeTo)

expression A variable that represents a ShapeRange object.

Parameters

Name

Required/Optional

Data Type

Description

AlignCmd

Required

MsoAlignCmd

Specifies the way the shapes in the specified shape range are to be aligned.

RelativeTo

Required

MsoTriState

Not used in Microsoft Excel. Must be False.

This example aligns the left edges of all the shapes in the specified range in myDocument with the left edge of the leftmost shape in the range.

Set myDocument = Worksheets(1) 
myDocument.Shapes.SelectAll 
Selection.ShapeRange.Align msoAlignLefts, False
Show:
© 2015 Microsoft