Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - Deleting Picture

Status
Not open for further replies.

rnegde

Technical User
Jan 13, 2002
23
US
I have an Excel worksheet that has had 2 pictures inserted on it. I need to be able to delete one of the pictures when I need to. Since this would be done repeatedly, I was trying to set up a macro or some kind of hot key combination that would do it. Since the picture is on the second page, it would keep me from having to scroll down and do it manually.

Is this something that is doable?? Can a macro delete a picture as long as you specify picture by either cell or name??

Any info on this would be greatly appreciated!!
 
try something like this

Code:
ThisWorkbook.ActiveSheet.Shapes("Object 2").Delete
 
Ratman late night special:

Just single click on a picture and its gone !

Sub auto_open()
Application.OnKey "d", "delpic"
End Sub

Sub delpic()
Application.DisplayAlerts = False
On Error Resume Next
If TypeName(Selection) = "Picture" Then Selection.Delete
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top