autoshapes round 2

S

scrabtree

The code:

ActiveSheet.Shapes.SelectAll
Selection.Delete

Deleted all the Autoshapes. It also deleted all the
buttons and dropdown boxes, too. How can I just delete
Autoshapes without deleting buttons etc.?
 
J

Jim Rech

Sub a()
Dim X As Shape
For Each X In ActiveSheet.Shapes
If X.Type = msoAutoShape Then X.Delete
Next
End Sub


--
Jim Rech
Excel MVP
| The code:
|
| ActiveSheet.Shapes.SelectAll
| Selection.Delete
|
| Deleted all the Autoshapes. It also deleted all the
| buttons and dropdown boxes, too. How can I just delete
| Autoshapes without deleting buttons etc.?
|
 
Top