View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_2_] Dave Peterson[_2_] is offline
external usenet poster
 
Posts: 420
Default Delete all drawings/shapes except DownArrows

The .name property isn't what you want to you. The Name is the string you see
in the namebox (to the left of the formulabar).

I'd try:

Option Explicit
Sub DeleteShapesExceptDownArrows()
Dim MyShape As Shape
For Each MyShape In ActiveSheet.Shapes
If MyShape.AutoShapeType < msoShapeDownArrow Then
MyShape.Delete
End If
Next MyShape
End Sub

On 02/23/2011 03:53, Pete wrote:

Sub DeleteShapesExceptDownArrows()
Dim MyShape As Object
For Each MyShape In ActiveSheet.Shapes
If MyShape.Name < msoShapeDownArrow Then
MyShape.Delete
End If
Next MyShape
End Sub


--
Dave Peterson