Deleting All Pictures

Written by Allen Wyatt (last updated August 2, 2025)

3

Theresa inherited a large number of workbooks, each including quite a few pictures. She needs to delete the pictures, but doing so one at a time is rather tedious. Theresa wonders if there is a way to open a workbook and quickly delete all the pictures rather than selecting them one at a time.

There are a couple of ways you can approach this task. One way to accomplish it is to follow these steps:

  1. Press F5. Excel displays the Go To dialog box.
  2. Click the Special button, in the lower-left corner. Excel displays the Go To Special dialog box.
  3. Click the Objects radio button.
  4. Click OK. Excel selects all the pictures in the worksheet.
  5. Press the Delete key. All the pictures are deleted.

Another way to do this is to click on one of the pictures so it is selected (handles appear around it), and then press Ctrl+A. That selects all the pictures and you can press the Delete key.

There are few major caveats to using this method of selecting and deleting. First, it works only in the currently active worksheet. Theresa wanted to delete all the pictures in the workbook, which means she would need to repeat these steps for each worksheet. Second, note that you are selecting objects, which is not limited to pictures. If the worksheet contains other objects such as shapes and embedded charts, those are selected (and subsequently deleted) as well.

Even if you only have pictures on the worksheet, deleting them using these steps only relieves some of the tedium that Theresa notes. A good way to remove the tedium is to use a macro to do the deletions. This macro will delete all the pictures on all worksheets in the current workbook.

Sub DeleteWorkbookPictures1()
    Dim ws As Worksheet

    For Each ws In ActiveWorkbook.Worksheets
        ws.Pictures.Delete
    Next ws
End Sub

Notice that the macro uses the Pictures collection. Documentation on this collection is spotty, at best, and it is not clear whether Microsoft officially recommends its use. What is clear is that each worksheet has a Pictures collection, and that collection is a subset of the larger Shapes collection.

This means that you could rewrite the macro to utilize the Shapes collection, if you prefer to stick to "official" collections. Here is a macro that does the exact same thing as the previous one:

Sub DeleteWorkbookPictures2()
    Dim ws As Worksheet
    Dim shp As Shape

    For Each ws In ActiveWorkbook.Worksheets
        For Each shp In ws.Shapes
            If shp.Type = msoPicture Then shp.Delete
        Next
    Next ws
End Sub

The macro steps through the Shapes collection on each worksheet and checks the .Type property of the shape. If the shape is a picture (msoPicture), then the shape is deleted.

If you want even more automation in the macro, you can step through all the workbooks in a folder and delete all the pictures. Here's how to accomplish the task:

Sub Delete_All_Pics_In_Folder()
    Dim sPath As String
    Dim sFile As String
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim shp As Shape
    Dim sMsg As String
    Dim iCount As String

    sPath = "C:\YourFolderPath\"
    sMsg = ""

    sFile = Dir(sPath & "*.xls*")
    Do While sFile <> ""
        Set wb = Workbooks.Open(sPath & sFile)

        iCount = 0
        For Each ws In wb.Worksheets
            For Each shp In ws.Shapes
                If shp.Type = msoPicture Then
                    shp.Delete
                    iCount = iCount + 1
                End If
            Next shp
        Next ws

        wb.Close SaveChanges:=True

        If iCount > 0 Then
            sMsg = sMsg & "Deleted " & iCount & " pictures in " & sFile & vbCr
        End If
        sFile = Dir
    Loop
    MsgBox sMsg
End Sub

The key to making this macro work is to copy all the workbooks you want to process into a single folder. Then, change sPath so that it contains the full path to the folder. It is very important that the path end with a backslash. The macro then uses the Dir function to return the names of each workbook in the folder. (A workbook, for this macro, is defined as any file that uses an extension that begins with .xls.)

The macro opens the workbooks, steps through each worksheet, checks each member of the Shapes collection, and deletes the shape if it is a picture. When all the worksheets in a workbook have been processed, the macro then saves the workbook and moves on to the next one. When all the workbooks have been processed, then the macro displays a message telling how many pictures were deleted in each workbook.

There is one other non-macro approach that should be mentioned before finishing out. If you prefer to not delete the pictures, you could simply hide them. This is done by configuring Excel to hide them, as discussed in this ExcelTip:

https://tips.net/T6124

The pictures remain in the workbook, they are simply hidden from view.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13949) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Adding AutoShapes

The graphics features of Excel allow you to add a number of predefined AutoShapes to a workbook. If you want to add ...

Discover More

End-of-Month Calculations

Don't want to use the EOMONTH function to figure out the end of a given month? Here are some other ideas for discovering ...

Discover More

Breaking a Document Link

Word allows you to link external information into your documents. If you no longer need to maintain the active link, you ...

Discover More

Dive Deep into Macros! Make Excel do things you thought were impossible, discover techniques you won't find anywhere else, and create powerful automated reports. Bill Jelen and Tracy Syrstad help you instantly visualize information to make it actionable. You’ll find step-by-step instructions, real-world case studies, and 50 workbooks packed with examples and solutions. Check out Microsoft Excel 2019 VBA and Macros today!

More ExcelTips (ribbon)

Moving and Copying Graphics Objects

Excel doesn't just work with numbers and text. You can also add graphics objects to your worksheets, and then use Excel's ...

Discover More

Pulling Text from a Cell and Placing It in a Shape

Graphic shapes you add to your worksheet can easily contain text; just click on the shape and start typing away. You may ...

Discover More

Setting a Transparent Color for an Image

Want to "see through" an image you place on a worksheet? You can do so by using the steps in this tip.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is eight more than 6?

2025-08-05 21:39:51

Francisco de Jesus Orozco Rioz

TYPO: "(A workbook, for this macro, is defined as any file that uses an extension that begins with .xls.)" should say "(A workbook, for this macro, is defined as any file that uses an extension that ends with .xls.)". In any case, the glob expression '*.xls*' selects the file if the text appears in any part of the filename, like 'budget_report.xls.docx'.


2025-08-04 10:13:16

J. Woolley

The Tip's 2nd and 3rd macros use the shp.Delete method to delete shapes of Type msoPicture. Instead of deleting them, you could hide them by replacing shp.Delete with the following:n    shp.Visible = FalsenPictures hidden in this way can be unhidden by repeating the macro with n    shp.Visible = Truenor by using the Selection Pane as described in my previous comment below.


2025-08-02 14:59:09

J. Woolley

The Tip mentions hiding pictures instead of deleting them as described here: https://tips.net/T6124nActually that Tip describes the option to hide all drawing objects, not just pictures, in a currently open workbook; once the option is set it applies to the specified workbook only and is retained when that workbook is saved. Notice drawing objects (a.k.a. Shape objects) include the following: Picture, Chart, Freeform, AutoShape, OLE object, etc.nThe following macro will toggle (hide/show) display of all drawing objects in the active workbook; this setting is equivalent to the option described above and is retained when the workbook is saved:nnSub ToggleHideShapes()n    With ActiveWorkbookn        .DisplayDrawingObjects = IIf(.DisplayDrawingObjects = xlHide, _n            xlDisplayShapes, xlHide)n    End WithnEnd SubnnIn case you never noticed, the Editing group of the Home tab includes nFind & Select > Selection Pane (Alt+H, ZE, FD, P). This opens a new pane listing all shapes on the active sheet. Each shape's name identifies its type unless you have renamed the shape. You can hide/show individual shapes or all shapes, but only on the active sheet. These settings are retained when the workbook is saved; they are independent of the workbook’s DisplayDrawingObjects property described above.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.