Macro to delete any control box and pictures

S

Steve

I recorded this macro:

ActiveSheet.Shapes("Control 3").Select
Selection.Cut
ActiveSheet.Shapes("Picture 1").Select
Selection.Cut
ActiveSheet.Shapes("Picture 2").Select
Selection.Cut

but it hang's (item with the spcified name wasn't found)

I assume by downloading various data, the numbers of the objects change, and
that's probably why it's hanging. Different data but all with the same
control box and pictures.
Is there a way to run a macro that will delete the control box and pictures.
Perhaps writing it as :
Cut any control, any picture, any button ?

Thanks,

Steve
 
G

Gord Dibben

Have you tried F5>Special>Objects>OK

Edit>Clear>All

May be too destructive if you have other objects you want to keep.


Gord Dibben MS Excel MVP
 
S

Steve

Thank you, but like you said, it's a bit too destructive, as I have a macro
button that it also gets cut.
Any thoughts on how to cut all but the macro button ?
 

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