Deleting All Pictures

Written by Allen Wyatt (last updated August 1, 2025)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365


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

Making Common Information Accessible

Got a bunch of info that is common to a lot of your documents? Here's a way to get that information standardized among ...

Discover More

Turning Off Document Protection

If you protect your document using the tools that Word provides, at some time you may need to turn off that protection. ...

Discover More

Word Count is Zero

If you use the Word Count tool and are surprised that it returns a count of 0, it could be because of what you selected ...

Discover More

Program Successfully in Excel! This guide will provide you with all the information you need to automate any task in Excel and save time and effort. Learn how to extend Excel's functionality with VBA to create solutions not possible with the standard features. Includes latest information for Excel 2024 and Microsoft 365. Check out Mastering Excel VBA Programming today!

More ExcelTips (ribbon)

Adding Drop Shadows

Want your shapes to really "pop" off the page? Add a drop shadow to them, as described in this tip.

Discover More

Setting the Default Fill Color for a Shape to None

When you insert a shape into a worksheet, Excel does some preliminary formatting on that shape. You can subsequently make ...

Discover More

Changing a Shape

Need to change a shape you previously added to your worksheet? It's easy to do using the graphics tools provided by ...

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 9 - 3?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form 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.