Removing "imaginary" objects

J

Juan Sanchez

If you are possitivelly sure that you do not wan't any
shape that could possibly be in the active sheet, be it a
line, circle, arrow, flow chart objet et. al. Non what so
ever, then you can use this...
'========================================
Sub DeleteAllObjects()
Dim MySH As Object

On Error Resume Next
For Each MySH In ActiveSheet.Shapes
MySH.Delete
Next
On Error GoTo 0

End Sub
'=========================================

On your worksheet, hit Alt+F11 youl be on the VBA screen,
Insert > Module, paste this in the module then hit Alt+F11
again to go to the exel worksheet.

Then go to Tools > Macro > Macros (or Alt+F8) and choose
DeleteAllObjects from list, the RUN...

*ALL AUTOSHAPES WILL, WILL, WILL BE DELETED, AND THERE IS
NO WAY BACK*

Cheers
Juan


-----Original Message-----
I am trying to hide columns in a worksheet, but I am
getting a message "Cannot shift objects off a sheet!"
 

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