Have the width/height of a autoshape placed in a cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Excel 2003 I have inserted 4 autoshape rectangle boxes. When I double on
the autoshape the Format Autoshape box appears and under the Size tab it show
the height and width of the autoshape box. My question is how can I have the
height and width information in this dialog box input into my spread sheet?
 
Just run this in your typical VBA module. This will display the heights and
widths of all of your shapes on the active sheet:

Sub ShapeSizes()
Dim MyShape As Shape
Dim i As Long

For Each MyShape In ActiveSheet.Shapes
MyShape.Select
With Selection
ActiveSheet.Cells(1 + i, 1) = .ShapeRange.Height
ActiveSheet.Cells(2 + i, 1) = .ShapeRange.Width
End With
i = i + 2
Next MyShape
End Sub
 
Back
Top