Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting selected images from Excel worksheet
I want to remove certain images from a spreadsheet. How do I modify
the code to only select and remove the images that appear in cell L43 and not all images on the active sheet? Public Sub Remove_Images() DimRange = Application.Cells.Range("L43") ScreenUpdating = False ActiveSheet.Pictures.Select Selection.Delete Application.ScreenUpdating = True End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
script for deleting images | Excel Discussion (Misc queries) | |||
Deleting images in Excel document | Excel Programming | |||
deleting selected rows | Excel Discussion (Misc queries) | |||
Deleting Multiple Images | Excel Discussion (Misc queries) | |||
Deleting selected macro buttons | Excel Programming |