Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Saving All Open Workbooks.

Saving All Open Workbooks

Written by Allen Wyatt (last updated March 7, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


3

If you work with lots of workbooks open at the same time, you know that it can be a pain to go through and save each of the open workbooks, in turn. Wouldn't it be great to have a single command that allowed you to save all the open workbooks, without the need to do it manually?

Unfortunately, there isn't such a command in the versions of Excel that use the ribbon interface, but you can create one using a macro. The following is a good example of one you could use:

Sub SaveAll()
    Dim Wkb As Workbook
    For Each Wkb In Workbooks
        If Not Wkb.ReadOnly And Windows(Wkb.Name).Visible Then
            Wkb.Save
        End If
    Next
End Sub

Save the macro in your Personal workbook, assign it to the Quick Access Toolbar or a shortcut key, and you can call it up as often as you like. It saves all the workbooks that are open, except those that are read-only or hidden.

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 (11079) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Saving All Open Workbooks.

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

Putting Character Codes to Work

If you know the character codes for some characters of interest, you can use those codes to do lots of tasks. This tip ...

Discover More

Limiting Who Can Delete Data

Excel allows you to protect your worksheet data in several different ways. Unfortunately, it doesn't allow you to protect ...

Discover More

Hyperlinks from Headings to the TOC

A table of contents is a great way to help organize lengthy documents. In a default TOC, you can use each entry as a ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Seeing All Open Workbook Names

Ever want to see a list of all the workbooks that are open? If you open more than nine, Excel only displays the first ...

Discover More

Creating a Workbook Clone

If you are afraid of messing up a workbook, consider doing your work on a clone of the workbook. Excel provides an easy ...

Discover More

Opening a Workbook to a Specific Worksheet

When you open a workbook, Excel displays the worksheet that was visible when the workbook was last saved. You may want, ...

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 one less than 9?

2021-04-16 03:14:23

Alan Elston

Hello Anna …
.. You can use the Workbook.SaveAs-Method …
…. https://docs.microsoft.com/en-us/office/vba/api/excel.workbook.saveas
…. In place of the Workbook.Save-Method (…
…. https://docs.microsoft.com/en-us/office/vba/api/excel.workbook.save ... )
….
… In that method, the first argument, FileName:= , would be the full path and file name of your file …

… So instead of …
… Wkb.Save …
… you would do like
… Wkb.SaveAs Filename:="C:\Users\Elston\Desktop" & "\" & Wkb.Name …

… Obviously you will need to change that first path bit to suit the location you want to save the file in. In that example, the file would be saved on my desktop


…. Alan Elston


2021-04-15 18:17:22

Anna

Thanks for the tip! However, how can you save all the opened workbooks to a specific location?


2020-03-08 21:01:21

Walter

I had multiple workbooks open in Excel 2010 and the Sub SaveAll() didn't work for me.

The following simple macro does the trick for me.
It prompts to save if changes were made in a workbook and also prompts with warning messages if need be.

Sub Close_all_Workbooks()
Workbooks.Close
End Sub

it also worked in Excel 2019, where the workbooks are open and multiple instances of Excel.

It's fairly simple and you may need to embellish it to do all of the things you would like.


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.