Macro to delete any control box and pictures

  • Thread starter Thread starter Steve
  • Start date Start date
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
 
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
 
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 ?
 
Back
Top