How To Delete More Than One Graphic From A Worksheet

  • Thread starter Thread starter Robert P. Stearns
  • Start date Start date
R

Robert P. Stearns

Is there a way to delete more than one graphic at a time from a worksheet?
Picking one at a time is a pain if you have lots to delete.
 
Robert P. Stearns...
Is there a way to delete more than one graphic at a time from a worksheet?
Picking one at a time is a pain if you have lots to delete.

Robert,

If they are shapes, then you can use the following:

Sub DeleteShapes()

Dim myShape As Shape

For Each myShape In ActiveSheet.Shapes
myShape.Delete
Next

End Sub


If it doesn't work, find out what the graphic is, and then just modify the
code to suit. Or come here and tell us what the "graphic" is, and we will
modify the code for you. One way to find out what the graphic is, is to
simply Tools | Macro | Record New Macro and then manually delete one
graphic. Look at the code generated. It will tell you what it deleted.

Hope that helps.

Regards,
Kevin
 
The graphics are jpg files that where copied and pasted into excel. I tried
recording a macro but nothing was recorded. In trying to record the macro, I
selected the graphic and clicked the delete button. Do you have any more
suggestions?
 
Did you try the macro Kevin provided, it should delete them if they are
inserted pictures. Another way would be to press F5, select special,
select objects and click OK

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
Then hit the delete key <vbg>.

Peo said:
Did you try the macro Kevin provided, it should delete them if they are
inserted pictures. Another way would be to press F5, select special,
select objects and click OK

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top