I don't know of any way to "deselect" something other than by selecting
something else.
I believe you need to use a loop to delete just the pictures you want. It
might look something like this:
Sub Macro1()
Dim Obj As Object
For Each Obj In ActiveSheet.DrawingObjects
Select Case Obj.Name
Case "Picture1", "Picture2"
'don't do anything
Case Else
Obj Delete
End Select
Next Obj
End Sub
PS: I used the macro recorder to get the code for selecting the objects on the
sheet. The line referred to ActiveSheet.DrawingObjects. When I put the cursor
on that word and pressed F1 to get help on the properties and methods, I got a
message about it being a hidden object, with no help available.
On Sat, 7 Aug 2004 19:25:28 -0500, Cutter
<<(E-Mail Removed)>> wrote:
>Hello
>
>Each week I copy a list of data from a web page and paste it into an
>Excel worksheet. The data, However, includes dozens of small graphic
>objects which I don't want so I have to delete them. I do this by
>Edit>Go To>Special>Objects to select all objects on the sheet but I
>have to deselect two objects before hitting delete. I tried recording
>a macro for this but instead of showing a way to deselect the two
>objects it listed all of the others.
>
>Is there a VBA equivalent to holding the shift key and clicking on the
>two objects to deselect them from the selection? The two objects for
>deselection are named Picture 1 and Picture 2.
>
>Thanks for any help you might have.
>
>
>---
>Message posted from http://www.ExcelForum.com/