Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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

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
script for deleting images Gor_yee Excel Discussion (Misc queries) 2 October 29th 07 12:38 PM
Deleting images in Excel document [email protected] Excel Programming 2 March 27th 07 02:57 AM
deleting selected rows Worker Bee Excel Discussion (Misc queries) 5 November 20th 06 01:37 PM
Deleting Multiple Images A.S. Excel Discussion (Misc queries) 3 August 19th 06 03:18 PM
Deleting selected macro buttons rabbi Excel Programming 1 August 18th 05 09:26 AM


All times are GMT +1. The time now is 09:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"