Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 183
Default delete picture within a specific range

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
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
How do I use formulae to display a specific picture in a cell? Tricia Excel Discussion (Misc queries) 1 June 19th 08 10:50 PM
Delete earlier 'Picture' version when new picture copied in JDaywalt Excel Programming 1 March 22nd 08 01:23 AM
Delete specific range of cells if containing "0" ElkySS Excel Programming 6 October 9th 06 07:28 PM
DELETE A PICTURE TUNGANA KURMA RAJU Excel Discussion (Misc queries) 4 November 24th 05 12:19 PM
Delete Specific Range Names Larry[_11_] Excel Programming 3 December 22nd 03 09:48 PM


All times are GMT +1. The time now is 04:54 PM.

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"