April 2006
Beginner
1114 pages
98h 16m
English
shaperange.Distribute(DistributeCmd, RelativeTo)
Distributes the shapes in a ShapeRange vertically or horizontally.
|
Argument |
Settings |
|---|---|
|
|
Can be |
|
|
Must be False in Excel. |
The following code distributes the shapes on a worksheet vertically; this is the equivalent of selecting Draw → Align or Distribute → Distribute Horizontally on the Drawing toolbar:
Sub DistributeVertically( )
Dim ws As Worksheet, sr As ShapeRange
Set ws = ActiveSheet
' Create a shape range for all shapes on sheet.
ws.Shapes.SelectAll
Set sr = Selection.ShapeRange
' Distribute shapes
sr.Distribute msoDistributeVertically, False
End SubRead now
Unlock full access