LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pam Pam is offline
external usenet poster
 
Posts: 128
Default Delete shapes in a range

I'm trying to delete shapes in a range. I have found this code from another
post, but it won't accept "TopLeftCell" (It says method or data member not
found) so I put in the range I wanted it to look in, but it deletes all the
shaps. Can you help me?

Dim sh as Worksheet, sh1 as Worksheet
Dim v as Variant, v1 as Variant
Dim rng as Range, rng1 as Range
Dim shp as Shape, i as Long, j as Long
set sh = Worksheets("Sheet1")
set rng = sh.Range("A11, B22, C33")
for each shp in sh.Shapes
set rng1 = sh.range(sh.TopLeftCell, sh.BottomRightCell)
if not intersect(rng,rng1) is nothing then
shp.Delete
end if
Next

 
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
Add and delete pictures and shapes jlclyde Excel Discussion (Misc queries) 2 October 22nd 08 02:54 PM
Delete shapes, not buttons ewan7279 Excel Programming 3 July 17th 07 12:00 PM
Delete all Shapes from selected Range Chip Pearson Excel Programming 0 December 15th 06 06:09 PM
HOW DO I DELETE SHAPES THAT ARE IN SPREADSHEETS? Chuck Excel Discussion (Misc queries) 2 February 19th 06 11:14 AM
Delete Shapes acces[_7_] Excel Programming 1 May 7th 04 06:51 PM


All times are GMT +1. The time now is 03:29 AM.

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

About Us

"It's about Microsoft Excel"