Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. 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: Creating Individual Workbooks.

Creating Individual Workbooks

Written by Allen Wyatt (last updated February 18, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


If you use Excel quite a bit, you know you may get some rather large workbooks from colleagues. Often it is desirable to break the workbook down, so that each worksheet is in its own workbook. While this can be done manually, the process quickly becomes tedious if you have a lot of breaking down to do.

This sort of repetitive work is a natural for a macro. The following macro, called BreakItUp, creates individual workbook files based on the worksheets in the current workbook. Thus, if the current workbook contains 25 worksheets, running this macro results in 25 individual Excel workbook files being created. Each workbook has a single worksheet, and the name of the workbook is the same as that of the worksheet.

Sub BreakItUp()
    Dim sht As Worksheet
    Dim NFName As String
    Const WBPath = "C:\"

    For Each sht In ActiveWorkbook.Worksheets
        sht.Copy
        NFName = WBPath & sht.Name & ".xlsx"
        ActiveWorkbook.SaveAs FileName:=NFName, _
            FileFormat:=xlNormal, CreateBackup:=False
        ActiveWindow.Close
    Next
End Sub

The BreakItUp macro stores the new workbooks in the root directory on the C: drive. If you want your workbooks saved in a different place, you can simply change the line in which the WBPath constant is created.

You should also know that it is relatively easy to crash this macro. For instance, if you use a character in a worksheet name that is not “legal” for a file name, the macro will rudely stop when it tries to create the file. Of course, you could easily make the modifications to the macro to check for and replace such illegal characters.

Another potential pitfall for the macro is that it will stop running if a file already exists that has the same name as a worksheet. For instance, let's suppose you have a worksheet named MySheet1. If there is already a file on disk called MySheet1.xls, then the macro will stop when it tries to overwrite the file. You can get around this by making sure there are no file name conflicts in the directory where the workbooks are being saved.

Finally, if your original workbook has formulas that reference other worksheets (besides the one on which the formula occurs), then those formulas won't work in the broken-out workbooks. For this reason, you'll want to carefully check what is created to make sure the workbooks fit your needs.

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

Using the INT Worksheet Function

The INT function allows you to convert a value to an integer. The effect the function has depends on the characteristics ...

Discover More

Backing Up Your Customized Toolbars

After customizing your Excel toolbars, it is a good idea to make a backup of the file that contains the information. ...

Discover More

Converting Individual Endnotes and Footnotes

Word makes it easy to convert all your footnotes to endnotes and vice versa. You may want to only convert a couple of ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Workbooks Opening as Read-Only

If Excel thinks a workbook should not be changed, there is a good chance it will be opened as read-only. This tip looks ...

Discover More

Opening a Workbook as Read-Only

When you need to work on a workbook, you may want to do so without modifying the original contents of the workbook. This ...

Discover More

Reducing File Size

As you work with a workbook (particularly one that contains macros) you may notice that the workbook size can become ...

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 2 + 8?

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.