VBA – How to delete quickly all pictures from Excel?

Probably, if you are programming with Excel as much as me, one day you have the following question – all the pictures in Excel are generated by my code and I really do not care to give them names. I simply want to delete them all. Concerning the fact that you do not name the generated pictures, it is a little difficult to do it, naming each picture.

Anyway this query has a solution in the following code:

It is quite a clever way to delete the pictures, eh? With a little modification, this can actually delete any shape you would like to. Simply change “Picture” to the name of the shape and change the “7” in the code to the number of the letters.

Simply to delete all the Shapes, then this is quite ok:

So far so good!

Tagged with: , , ,