Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Deleting shapes

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Deleting shapes

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
;-)


Dr.Schwartz wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Naming Auto Shapes and Creating new Shapes AL2000 Excel Discussion (Misc queries) 3 September 10th 07 04:12 AM
When drawing shapes in excel the shapes keep disappearing Tape Excel Discussion (Misc queries) 1 October 6th 06 04:23 PM
Deleting Shapes aftamath Excel Discussion (Misc queries) 5 November 5th 05 12:37 AM
Deleting shapes Steve Excel Programming 4 June 16th 04 05:23 PM
Deleting shapes crashes for me. (Excel 97 vba) Excel Question Excel Programming 0 October 23rd 03 02:30 AM


All times are GMT +1. The time now is 06:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"