PC Review


Reply
Thread Tools Rate Thread

delete picture within a specific range

 
 
caroline
Guest
Posts: n/a
 
      30th Mar 2009
hello,
I am using this code found in Search results:
It works very well on a new workbook/sheet, but when I try to use it on my
existing workbook/sheet, it gives me error 13 on that line "For Each pic In
ws.Pictures"
Any pointer would be most welcome. This is driving me crazy.
Thanks
here's the full code

Dim s As String
Dim pic As Picture
Dim rng As Range

Set ws = ActiveSheet

Set rng = ws.Range("F11:J32")

For Each pic In ws.Pictures
With pic
s = .TopLeftCell.Address & ":" & .BottomRightCell.Address
End With
If Not Intersect(rng, ws.Range(s)) Is Nothing Then
pic.Delete
End If
Next
--
caroline
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete rows within a specific range macro GraduatePlease09 Microsoft Excel Programming 1 17th Apr 2009 05:05 AM
Delete specific range of cells if containing "0" =?Utf-8?B?RWxreVNT?= Microsoft Excel Programming 6 9th Oct 2006 07:28 PM
Count If Specific word in specific range sizz1@hotmail.com Microsoft Excel Misc 2 16th May 2006 10:14 AM
Delete specific row in range Jay Northrop Microsoft Excel Programming 1 18th Apr 2005 08:17 AM
Delete Specific Range Names Larry Microsoft Excel Programming 3 22nd Dec 2003 09:48 PM


Features
 

Advertising
 

Newsgroups
 


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