MrExcel Publishing
Your One Stop for Excel Tips & Solutions

selecting & deleting all pictures in VBA


Posted by Ian on December 21, 1999 7:33 AM

Is there a way of selecting all the pictures in a spreadsheet? I can't use the select("picture ##") method because the picture number is different every time. Maybe I could insert the pictures with assigned numbers?

Does this even make sense?

Posted by Ivan Moala on December 22, 1999 3:02 AM

Ian
One way to delete ALL pictures (in activesheet) is;

Sub tester()
Dim DrObj
Dim Pict
Set DrObj = ActiveSheet.DrawingObjects
For Each Pict In DrObj
If Left(Pict.Name, 7) = "Picture" Then
Pict.Select
Pict.Delete
End If
Next
End Sub


Ivan