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 SubSave 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.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11079) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Saving All Open Workbooks.
Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!
If your worksheet is linked to data in other worksheets, you may need to change the link from time to time. Here's how to ...
Discover MoreHaving trouble saving a workbook? It could have to do with the age, size, and complexity of that workbook. This tip ...
Discover MoreEver want to see a list of all the workbooks that are open? If you open more than nine, Excel only displays the first ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2016-07-13 09:10:51
David Orchard
Up until Windows 10 and whatever version of excel I'm using, I just clicked on the cross on top-right corner and chose "Save all" - now its disappeared.
2016-03-09 21:46:28
apply your code save all workbook above u mentioned.
but, i show the error "subscript out of range"
what reason pls reply tq
2014-10-30 10:14:35
@ Doug
Allen's code is like one of my basic tool-kit Subs, included in every project and works until, tada!, someone uses a New Window.
Try this. It uses the Application.Window object fin the For...Next and Window.Parent is the workbook. It worked in my tests.
Sub SaveAll()
Dim Wkb As Workbook
Dim win As Window
For Each win In Application.Windows
If Not win.Parent.ReadOnly And win.Visible Then
win.Parent.Save
End If
Next win
End Sub
2014-10-29 17:00:46
Doug
It appears that this macro fails if you have more than one window open for the same workbook (ie, you go to view->new window). A way to modify the code to include this case would be helpful.
2014-08-15 08:01:35
Eva
Attempting to run this code results in a 'subscript out of range' error.
2014-07-13 00:32:32
Great tip. It worked fine.
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2018 Sharon Parq Associates, Inc.
Comments