Deleting Pictures

G

Guest

I have a large Excel spreadsheet with about 2000 pictures. I am writing a
VBA script to delete all of the pictures. the problem is identifying the
ones to delete. If I Set myexcelworkbook = ActiveWorkbook then look in local
windows, "Myexcelworkbook", "ActiveSheet", "Shapes" - I only get a list of
256 shapes with the names ranging "Picture 3" to Picture 259". What happend
to the almost 2000 other pictures. I recorded macro and selected several and
I have quite a few in the "Picture 2009" range.

Am I looking the the wrong place to find the picture names so I can delete
each one?
Or better yet, is there an easier way to delete all pictures on my excel
spreatsheet?

Thanks
 
G

Guest

I figured it out. I used information from another post that I didn't see
earlier. I used something like:
For Each shp In ActiveSheet.Shapes
ActiveSheet.Shapes(shp.Name).Select
Selection.Cut
Next

Thanks
 
N

Norman Jones

Hi Brmauer,

A non-looping method:

Sub Tester
Activesheet.Pictures.Delete
End sub
 

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

Top