Deleting shapes

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

Guest

How can I programatically select and delete x number of shapes in a sheet?

I tried this with no luck:

ActiveSheet.Shapes.Select
Selection.Delete

Thanks
The Doctor
 
Doc
This could depend on how many you want to delete or if there are only
certain types of shape to delete

To delete all, try:-
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
shp.Delete
Next

To delete by name/type try this for AutoShapes only, assuming shapes haven't
been renamed:-
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
If shp.Name Like "AutoShape*" Then
shp.Delete
End If
Next

Happy Friday
;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top