Deleting Pictures - Brain meltdown

F

Frogtoe

Any idea how to delete an inserted picture in Excel in VBA:

(There is probably a really simple solution to my days of frustration
with this, but at this point it's a downward spiral)

If a picture is aleady on a worksheet, how can I select this and delete
it (there will only be one picture on a sheet, but probably a few
charts also)
 
J

JE McGimpsey

One way:

Dim shShape As Shape
For Each shShape In ActiveSheet.Shapes
If shShape.Type = msoPicture Then
shShape.Delete
Exit For
End If
Next shShape
 
D

Dave Peterson

How about:

activesheet.pictures.delete

Frogtoe < said:
Any idea how to delete an inserted picture in Excel in VBA:

(There is probably a really simple solution to my days of frustration
with this, but at this point it's a downward spiral)

If a picture is aleady on a worksheet, how can I select this and delete
it (there will only be one picture on a sheet, but probably a few
charts also)
 
Top