View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_796_] Leith Ross[_796_] is offline
external usenet poster
 
Posts: 1
Default Deleting selected images from Excel worksheet


Hello Tom,

This macro checks if the picture contains cell "L43". If it does then
the picture is deleted.

Code:
--------------------

Sub DeletePics()

Dim Pic As Excel.Picture
Dim Rng As Range

For Each Pic In ActiveSheet.Pictures
Set Rng = Union(Pic.TopLeftCell, Pic.BottomRightCell)
If Not Intersect(Range("L43"), Rng) Is Nothing Then Pic.Delete
Next Pic

End Sub

--------------------


--
Leith Ross

Sincerely,
Leith Ross

'The Code Cage' (http://www.thecodecage.com/)
------------------------------------------------------------------------
Leith Ross's Profile: 75
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170896

Microsoft Office Help