ShapeRange.Distribute Method
Horizontally or vertically distributes the shapes in the specified range of shapes.
Syntax
expression.Distribute(DistributeCmd, RelativeTo)
expression A variable that represents a ShapeRange object.
Parameters
| Name | Required/Optional | Data Type | Description |
|---|---|---|---|
| DistributeCmd | Required | MsoDistributeCmd | Specifies whether shapes in the range are to be distributed horizontally or vertically. |
| RelativeTo | Required | MsoTriState | Not used in Microsoft Excel. Must be False. |
Example
This example defines a shape range that contains all the AutoShapes on myDocument and then horizontally distributes the shapes in this range. The leftmost shape retains its position.
| Visual Basic for Applications |
|---|
|