How to delete objects in specific range ?

sthanawa

Board Regular
Joined
Jul 5, 2006
Messages
80
Hi All ,

Please suggest as below problem.

I have one specific range A1:K10.
In this specific range. I have some shape object and some picture.

Outer this specific range , I also have other shape and picture too.

How can I delete all objects in this specific range ?
but do not delete other object out of said specific range.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Code:
Sub delshape()
Dim sh As Shape, r As Range
For Each sh In ActiveSheet.Shapes
Set r = Range(sh.TopLeftCell.Address, sh.BottomRightCell.Address)
Set r = Application.Intersect(r, [a1:k10])
If Not r Is Nothing Then sh.Delete
Next
End Sub

Regards
Northwolves
 
Upvote 0

Forum statistics

Threads
1,223,864
Messages
6,175,056
Members
452,607
Latest member
OoM_JaN

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