Excel Delete All Auto Shapes: Safe Ways to Remove Them
Yes. You can delete every AutoShape in an Excel worksheet with a short VBA macro, or remove selected shapes manually; Excel does not provide a universal “delete all AutoShapes” command in the ribbon. Before deleting, save a copy of the workbook, because the action can remove useful arrows, callouts, text boxes, and other drawing objects.
What Excel Calls an AutoShape
AutoShapes are drawing objects such as rectangles, circles, lines, arrows, stars, speech bubbles, and flowchart symbols. In Excel, people often use “shapes” more broadly to include text boxes, pictures, charts, form controls, and other objects. That distinction matters: a command that removes all shapes may also remove items you meant to keep, while a macro aimed specifically at AutoShapes may leave pictures or charts untouched.
Objects belong to a worksheet, so deleting shapes from one sheet does not necessarily affect other sheets. A workbook can also contain objects on hidden sheets, and those will not be apparent while you are viewing a normal worksheet. Decide whether you want to clean one sheet, several selected sheets, or the entire workbook before choosing a method.
Delete Shapes Manually on One Worksheet
For a small number of objects, manual selection gives you the most control. In desktop Excel, use the following approach:
- Open the worksheet and choose Home > Find & Select > Selection Pane to inspect and select objects individually. You can also use Find & Select > Select Objects to drag a selection box around objects on the sheet.
- To select all drawing objects on the active sheet, press F5 or Ctrl+G, choose Special, select Objects, and choose OK. Depending on your Excel version and interface, the dialog labels or available commands can vary.
- Press Delete to remove the selected objects. If the selection includes something you need, use Ctrl+Z immediately to undo.
Selecting all objects this way is not necessarily limited to AutoShapes. It may include other selectable objects on the sheet, such as pictures or charts, so inspect the selection or use the Selection Pane if keeping particular objects is important. The Selection Pane is also useful when objects overlap or are difficult to click.
Delete All Shapes with a VBA Macro
For many shapes, VBA is usually faster and more precise. This example deletes objects whose type is an AutoShape from the active worksheet, while leaving other object types, such as pictures and charts, alone:
Sub DeleteAutoShapesOnActiveSheet()
Dim i As Long
For i = ActiveSheet.Shapes.Count To 1 Step -1
If ActiveSheet.Shapes(i).Type = msoAutoShape Then
ActiveSheet.Shapes(i).Delete
End If
Next i
End Sub
The loop runs backward because deleting an item changes the positions of the remaining items in the collection. Starting at the last item avoids skipping an object as the collection changes. The type check is the important distinction: a macro that simply deletes every item in the worksheet’s Shapes collection can remove more than AutoShapes.
To run it, work on a saved copy, open the VBA editor with Alt+F11 in desktop Excel, insert a standard module, paste the code, and run the procedure. If Excel displays a security warning, do not enable macros in a workbook unless you trust its source. If you do not want to keep the macro, save the cleaned workbook in a macro-free format after running it; saving as a format that does not support VBA removes the macro code, not the deletions already made.
Remove Shapes from Several Worksheets
If the same cleanup is needed across worksheets, modify the macro to loop through the workbook’s worksheets. For example:
Sub DeleteAutoShapesInWorkbook()
Dim ws As Worksheet
Dim i As Long
For Each ws In ThisWorkbook.Worksheets
For i = ws.Shapes.Count To 1 Step -1
If ws.Shapes(i).Type = msoAutoShape Then
ws.Shapes(i).Delete
End If
Next i
Next ws
End Sub
This version visits worksheets in the workbook containing the macro, including hidden worksheets. It does not automatically process chartsheets, which are separate from worksheets. If the workbook has hidden sheets, consider unhiding and reviewing them first, or change the code to target only named worksheets. A workbook-wide macro can make many irreversible-looking changes at once, so a backup is especially important.
Shapes, Pictures, and Other Objects
A frequent misconception is that “delete all shapes” means “delete only decorative shapes.” In Excel’s object model, the Shapes collection can contain different kinds of drawing objects. Pictures, text boxes, grouped objects, and form controls may be represented there too. A broad deletion loop can therefore remove items that do not look like ordinary shapes.
Likewise, deleting AutoShapes does not delete cell contents or formatting. It will not clear values, formulas, comments, or cell borders. Charts and pictures are distinct object types for a type-filtered macro, although a manual Select Objects operation may select them along with shapes. If your actual goal is to remove pictures, buttons, charts, or every drawing object, adjust the selection or code to match that goal rather than relying on the word “shape.”
Common Problems and Safer Checks
- The macro removes too much: Confirm that it checks for
msoAutoShape. A loop that deletes every entry inShapesis broader. - Some shapes remain: Check whether the remaining objects are pictures, text boxes, controls, or other types rather than AutoShapes. Also check hidden worksheets if you intended a workbook-wide cleanup.
- You cannot select or delete an object: The worksheet may be protected, or the object may be difficult to access because it overlaps another object. Review sheet protection and use the Selection Pane. Do not remove protection unless you are authorized and know the password or workbook settings.
- The code does not run: VBA macros work in desktop Excel, not in Excel for the web. Macro settings, workbook format, or a missing reference can also affect execution;
msoAutoShapeis an Office constant available in the usual Excel VBA environment. - Undo is unavailable: Treat a macro as a bulk change and make a backup first. Do not assume the normal Undo history will restore a macro’s deletions.
After cleanup, save under a new filename if the original must remain intact. Then inspect the worksheet at different zoom levels and check any hidden sheets or grouped objects relevant to your task.
Frequently Asked Questions
Can I delete all AutoShapes without deleting pictures?
Yes. Use a VBA loop that tests each object’s type for msoAutoShape before deleting it. Avoid a broad loop that deletes every object in the Shapes collection.
Can I delete all shapes in Excel without VBA?
Yes, on one worksheet you can use F5 or Ctrl+G, choose Special, select Objects, and press Delete. That may select pictures and other objects as well as AutoShapes.
Does deleting shapes remove text in cells?
No. Shapes are separate drawing objects. Deleting them does not normally erase worksheet cell values, formulas, or formatting.
Will the macro work in Excel for the web?
No. Excel for the web does not run VBA macros. Use desktop Excel to run VBA, or select objects manually where the web interface provides the necessary selection commands.
How do I remove shapes from every sheet?
Use a macro that loops through the workbook’s worksheets and deletes only objects of the type you intend to remove. Save a backup first, and remember that hidden worksheets are included unless you restrict the macro.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.