It seemed quite consuming if I was to select and delete each individually. Worse I discovered that I couldn't select some of the objects (checkboxes). I learned two new techniques for mass deleting objects.
If you can select the objects
- Press F5 -- this opens the "Go To" dialog box
- Click Special... -- this opens the "Go To Special" dialog box
- Select the Objects radio button
- Click OK -- this closes the dialog box and all the objects in the worksheet are selected
- Press Delete and all the objects are deleted
- If you don't want all the objects deleted, first un-select those you don't want to lose.
- If you get a message "no objects found", then move on to the next method.
For those objects that can't be selectedFor those that know how to create a macro, here's the macro:
Dim obj As ObjectFor Each obj In ActiveSheet.Shapesobj.DeleteNextEnd Sub
For the rest of us who need a reminder...
- Press Alt-F8 to display the Macro dialog box
- Enter a new macro name (such as "foo") in the text box just below "Macro name:"
- This will change the Create button from an inactive to active state
- If you already have one or more macro, the name of one may already be in the "Macro name:" text box. That's ok, just type over it and Excel will realize you're wanting to create a new macro.
- Click Create -- this opens the Visual Basic Editor
- Copy the lines above and paste into the edit window
- Note if you didn't use "foo" as a name, you will need to make sure you update the macro code accordingly
- Close the editor window -- you should be back on your worksheet
- Press Alt-F8 again
- Select your new macro and click Run -- all your objects should now be deleted from your worksheet
That's all there is too it! It took me longer to write this than it'll take you to read and use. ;)