Log in
x
or
x
x
Register
x

or
0
0
0
s2sdefault

How to split a workbook to separate Excel files in Excel?

You may need to split a large workbook to separate Excel files with saving each worksheet of the workbook as an individual Excel file. For example, you can split a workbook into multiple individual Excel files and then deliver each file to different person to handle it. By doing so, you can get certain persons handle specific data, and keep your data safe. This article will introduce ways to split a large workbook to separate Excel files based on each worksheet.

Split a workbook to separate Excel files with copying and pasting

Split a workbook to separate Excel files with VBA code

Split a workbook to separate Excel / PDF / CSV / TXT files with Kutools for Excel easily


Split a workbook to separate Excel files with copying and pasting


In usual, using Copy command and Paste command can save a workbook as a Separate Excel file manually. Firstly, select the whole worksheet that you want to save as a separate file, create a new workbook, and then paste it in the new workbook, at the end saves it.

This way is easy-to-use if you need to split only a few worksheets as separate files. However, it must be time-consuming and tedious to split many worksheets with copying and pasting manually.


Split a workbook to separate Excel files with VBA code

The following VBA code can help you quickly split multiple worksheets of current workbook to separate Excel files, please do as follows:

1. Create a new folder for the workbook that you want to split, because the split Excel files will be stayed at the same folder as this master workbook.

2. Hold down the ALT + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.

3. Click Insert > Module, and paste the following code in the Module Window.

VBA: Split a workbook into multiple workbooks and save in the same folder.

Sub Splitbook()
'Updateby20140612
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
    xWs.Copy
    Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
    Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

4. Press the F5 key to run this code. And the workbook is split to separate Excel files in the same folder with the original workbook. See screenshot:

Note: If one of the sheets has the same name with the workbook, this VBA cannot work.


Split a workbook to separate Excel / PDF / CSV / TXT files with Kutools for Excel easily

If you have Kutools for Excel installed, its Split Workbook tool can split multiple worksheets as separate Excel files conveniently and quickly with only a few clicks.

Kutools for Excel : with more than 120 handy Excel add-ins, free to try with no limitation in 60 days. 

1. After installing Kutools for Excel, click Enterprise > Workbook > Split Workbook , see screenshot:

2. In the Split Workbook dialog box, do the following operations:

(1.) All worksheet names are checked by default. If you don’t want to split some of the worksheets, you can uncheck them;

(2.) From the Save as type drop down, choose one file type you want to split and save.

(3.) Then click Split button, and in the popping out Browse For Folder dialog box, please specify a file folder to locate the separate files.

Note: If you want to avoid splitting the hidden or blank worksheets, you can check the Skip hidden worksheets or Skip blank worksheets box.

3. And then click OK to start splitting, now the selected worksheets are saved as new separated workbooks. Each new workbook is named with the original worksheet name. See screenshot:

Kutools for Excel's Split Workbook tool makes it easy to split active workbook into individual Excel files (one file contains one worksheet), and each Excel file carries the name of the worksheet. You can set to skip all the blank and hidden worksheets. Read more…

Click Download and free trial Kutools for Excel Now !


Demo: Split or save each worksheet of one workbook as separate excel / txt / csv / pdf files

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Related articles:

Combine multiple workbooks to single workbook

Save a selection as individual file


Recommended Productivity Tools

Office Tab

gold star1 Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

Kutools for Excel

gold star1Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

gold star1200 New Features for Excel, Make Excel Much Easy and Powerful:

  • Merge Cell/Rows/Columns without Losing Data.
  • Combine and Consolidate Multiple Sheets and Workbooks.
  • Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
  • Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
  • More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...

Screen shot of Kutools for Excel

btn read more      btn download     btn purchase

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
People in conversation:
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Emmanuel · 16 days ago
    Hi, can I add or modify the filename?
  • To post as a guest, your comment is unpublished.
    CMG · 23 days ago
    Hi, can I get VBA to split a file with multiple tabs into separate files and save in their respective folders? i.e. If I have a report with 189 tabs each tab for different clients; can I separate those tabs and save each file in a folder specific to that client? The report varies with the number of tabs through out the month.
  • To post as a guest, your comment is unpublished.
    MAB · 1 months ago
    Hi - Can I get VBA to split a file with multiple tabs into files with multiple tabs? i.e. if I have a file with 2 tabs and data in both tabs with a field called customer -100 customers-, can I get VBA to create one file per customer -100 files- with two tabs each?
  • To post as a guest, your comment is unpublished.
    pippa hatt · 1 months ago
    help ive done this loads of times however today its saying an error on the Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx" what am i doing wrong
    • To post as a guest, your comment is unpublished.
      LR · 1 months ago
      You may need to change ".xlsx" on line 9 to ".xls" instead
      • To post as a guest, your comment is unpublished.
        Eben · 11 days ago
        It does that because of the spaces for indentation on lines 8 - 10. Also kept me busy a while to figure out why it's doing that now.
  • To post as a guest, your comment is unpublished.
    Kelley · 2 months ago
    Hi - instead of splitting each worksheet into a new workbook, is there a way to split groups of worksheets into new workbooks? Ex. Sheet1, Sheet2, Sheet3 go into a workbook, and Sheet4, Sheet5, and Sheet6 go to a second workbook, rather than six new workbooks?