Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have a number of rectangles that I want to delete from an area on a worksheet. What is the quickest way to do this ? I have tried the following but it didn't quite work ... Sub rem1() Set Shr = Sheets("Reports") For Each Rectangle In Shr.Range("B26:V53") ' graph area Rectangle.Delete Next End Sub Thanks in advance Andrew B |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can you just look at the topleftcell of the shape?
option explicit sub rem2() dim myRect as Rectangle dim myRng as range set myrng=worksheets("Reports").range("B26:v53") for each myrect in myrng.parent.rectangles if intersect(myrect.topleftcell, myrng) is nothing then 'not in that area else myrect.delete end if end sub (Untested--so watch out for typos!) Andrew B wrote: Hi I have a number of rectangles that I want to delete from an area on a worksheet. What is the quickest way to do this ? I have tried the following but it didn't quite work ... Sub rem1() Set Shr = Sheets("Reports") For Each Rectangle In Shr.Range("B26:V53") ' graph area Rectangle.Delete Next End Sub Thanks in advance Andrew B -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clearing cells without clearing formulas | Excel Discussion (Misc queries) | |||
Clearing #N/A's in one go? | Excel Worksheet Functions | |||
Clearing #VALUE | Excel Worksheet Functions | |||
How to insert small colored dots or rectangles in cells of excel | Excel Discussion (Misc queries) | |||
ClearContents not clearing :( | Excel Programming |