LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default deleting shapes with VBA code

I have a worksheet that containes a number of shapes (pictures). The number
could range from 1 to 30. I want to deleate all the shapes at one time
EXCEPT for one particular shape.
With the code below I can select all the shapes in the worksheet and delete
them. The problem is it also deletes the one shape I want to retain.

Set myDocument = Worksheets("Form-99")
myDocument.Shapes.SelectAll
Set sr = Selection.ShapeRange
Selection.Cut

I tried setting a range of column Q; all the shapes I want to delete are in
the Q column but there is also data in the column I don't want to delete, I
only want to remove the shapes. The problem is that this method only deletes
one shape for each time it runs, it doesn't delete all the shapes with one
run cycle. I tried deleteAll with the range code but it didn't work. Thanks
for any help you can offer.

Sheets("Form-99").Select
ActiveSheet.Shapes("Signature").Select
ActiveSheet.Shapes.Range(Array("Q8:Q74")).Select
Selection.Cut
--
Rick
 
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
Deleting Shapes aftamath Excel Discussion (Misc queries) 5 November 5th 05 12:37 AM
Deleting Shapes in a worksheet Glen Mettler[_4_] Excel Programming 8 July 11th 05 11:32 AM
Deleting shapes in an area Tim Excel Programming 2 October 27th 04 08:51 PM
Deleting shapes Dr.Schwartz Excel Programming 1 October 15th 04 10:18 AM
Deleting shapes Steve Excel Programming 4 June 16th 04 05:23 PM


All times are GMT +1. The time now is 06:04 AM.

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"