Eradicate the clip art scourge! :mad:

nigelandrewfoster

Well-known Member
Joined
May 27, 2009
Messages
747
Hi, You would make me very happy indeed if you could help me with a simple problem (for those in the know, I am sure) I have been wrestling with on and off for ages, but without success. I simply want to highlight a range on my worksheet and run a macro which removes every piece of word art/shape etc from that range. Any ideas? Thanks in advance for your interest in this post.
Nigel Foster
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi, You would make me very happy indeed if you could help me with a simple problem (for those in the know, I am sure) I have been wrestling with on and off for ages, but without success. I simply want to highlight a range on my worksheet and run a macro which removes every piece of word art/shape etc from that range. Any ideas? Thanks in advance for your interest in this post.
Nigel Foster

This attempt stops at the red line with "Object does not support this property or method":
Code:
Sub Shape_Removal()

Dim Sh As Shape, Delete_Range As Range
Set Delete_Range = Selection
    With ActiveSheet
       For Each Sh In .Shapes
          [COLOR="Red"] If Not Application.Intersect(Sh.TopLeftCell, .Delete_Range) Is Nothing Then Sh.Delete[/COLOR]
      
        Next Sh
    End With
End Sub
 
Upvote 0
This worked:-
Code:
Dim Sh As Shape, Delete_Range As Range
Set Delete_Range = Selection
  With ActiveSheet
       For Each Sh In .Shapes
           If Not Intersect(Sh.TopLeftCell, Delete_Range) Is Nothing Then
                Sh.Delete
           End If
      Next Sh
    End With
Possibly because the "Delete_Range" Parent is the active sheet.
 
Last edited:
Upvote 0
I am extremely happy. Some of the macros I have written in the past have led to a "build up" of shapes, on top of each other, so many that it's actually been slowing down my computer. Thanks so much. Don't follow the ""Delete_Range" Parent" comment, but it worked!
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,391
Members
452,909
Latest member
VickiS

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top