Академический Документы
Профессиональный Документы
Культура Документы
com/documents/excel/628-excel-split-
workbook.html) version of this link.
Log in (/login.html) Register (/login.html?view=registration)
Outlook Tips
(/documents/outlook.html)
D. Split a workbook to separate Excel / PDF / CSV / TXT files with Kutools for Excel easily
Quickly Split A Workbook To Separate Excel / PDF / TXT / CSV Files In Excel
Normally we can split a workbook to individual Excel files with the Move or Copy feature in Excel. But Kutools for Excel's Split
Workbook (/product/kutools-for-excel/split-the-current-excel-workbook.html) utility can help you easily split a workbook and
save each worksheet as a separate PDF/TEXT/CSV file or workbook in Excel. Full Feature Free Trial 30-day!
(/download/kutools-for-excel.html)
(/download/kutools-for-
excel.html)
Kutools for Excel (/product/kutools-for-excel.html) - Includes more than 300 handy tools for Excel. Full feature free trial 30-day,
no credit card required! Get It Now (/download/kutools-for-excel.html)
Kutools for
Office Tab Excel
Enable Solves
Tabbed Most
Editing of YourinProblems,
and Browsing Office, and Make and YourIncreases
Work MuchYour Productivity By
Easier...
80%. Full Features 30-day Free Trial.
i (https://www.addthis.com/website-tools/overview?utm_source=AddThis%20Tools&utm_medium=image&utm_campaign=Marketing%20tool%20logo)
Read More... (/product/office-tab.html) Free Download... (/download/office-tab.html)
Yes please! (https://www.extendoffice.com/download/kutools-for-excel.html)
/
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in
the future.
More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies
to English Words.
Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge
Duplicate Rows and Sum.
Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to
Multiple Columns.
Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in
Bulk.
Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold,
formulas, comment...
More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your
enterprise or organization.
Read More... (/product/kutools-for-excel.html) Free Download... (/download/kutools-
for-excel.html)
Split A Workbook To Separate Excel Files With Copying And Pasting
(/product/office-tab.html)
Amazing! Using Efficient Tabs In Excel Like Chrome, Firefox And Safari! (/Product/Office-
Save 50% Of Your Time, And Reduce Thousands Of Mouse Clicks For You Every Day!
(/Product/Office-Tab.Html)
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 is an easy-to-use way 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.
This method will introduce the Move or Copy feature to move or copy the selected sheets to a new workbook and save as a
separate workbook. Please do as follows:
1. Select the sheets in the Sheet tab bar, right click, and select Move or Copy from the context menu. See screenshot:
Note: Holding Ctrl key, you can select multiple nonadjacent sheets with clicking them one by one in the Sheet tab bar; holding Shift
key, you can select multiple adjacent sheets with clicking the first one and the last one in the Sheet tab bar.
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity By
80%. Full Features 30-day Free Trial.
i (https://www.addthis.com/website-tools/overview?utm_source=AddThis%20Tools&utm_medium=image&utm_campaign=Marketing%20tool%20logo)
3. Now all selected sheets are copied to a new workbook. Click File > Save to save the new workbook.
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
1 Sub Splitbook()
2 'Updateby20140612
3 Dim xPath As String
4 xPath = Application.ActiveWorkbook.Path
5 Application.ScreenUpdating = False
6 Application.DisplayAlerts = False
7 For Each xWs In ThisWorkbook.Sheets
8 xWs.Copy
9 Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
10 Application.ActiveWorkbook.Close False
11 Next
12 Application.DisplayAlerts = True
13 Application.ScreenUpdating = True
14 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:
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity By
80%. Full Features 30-day Free Trial.
i (https://www.addthis.com/website-tools/overview?utm_source=AddThis%20Tools&utm_medium=image&utm_campaign=Marketing%20tool%20logo)
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 (/product/kutools-for-excel.html) - Includes more than 300 handy tools for Excel. Full feature free trial 30-
day, no credit card required! Get It Now (/download/kutools-for-excel.html)
1. After installing Kutools for Excel, click Kutools Plus > Split Workbook , see screenshot:
Note: If you want to avoid splitting the hidden or blank worksheets, you can check the Skip hidden worksheets or Skip blank
worksheets box.
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity By
80%. Full Features 30-day Free Trial.
i (https://www.addthis.com/website-tools/overview?utm_source=AddThis%20Tools&utm_medium=image&utm_campaign=Marketing%20tool%20logo)
Now the checked worksheets are saved as new separated workbooks. Each new workbook is named with the original worksheet
name. See screenshot:
Demo: Split Or Save Each Worksheet Of One Workbook As Separate Excel / Txt / Csv / Pdf Files
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity By
Kutools for Excel includes more
80%. Full Features 30-day Free Trial.
than 300 handy tools for Excel, free to try without limitation in 30 days. Download and Free
i (https://www.addthis.com/website-tools/overview?utm_source=AddThis%20Tools&utm_medium=image&utm_campaign=Marketing%20tool%20logo)
Trial Now (/download/kutools-for-excel.html)!
Yes please! (https://www.extendoffice.com/download/kutools-for-excel.html)
/
Related Articles:
Kutools For Excel Solves Most Of Your Problems, And Increases Your Productivity By 80%
Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create
Mailing List and send emails...
Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells);
Paste to Filtered Range...
Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate
Cells; Compare Ranges...
Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks;
Random Select...
Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check
Boxes and more...
Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content
and Comments...
Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special
Filter by bold, italic...
Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls,
xlsx and PDF...
More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your
enterprise or organization. Full features 30-day free trial.
(/download/kutools-for-excel.html)
Office Tab Brings Tabbed Interface To Office, And Make Your Work Much Easier
Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
Open and create multiple documents in new tabs of the same window, rather than in new windows.
Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
(/download/office-tab.html)
95 Comments Login
Sort by Newest b
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity By
Say something here...
80%. Full Features 30-day Free Trial.
i (https://www.addthis.com/website-tools/overview?utm_source=AddThis%20Tools&utm_medium=image&utm_campaign=Marketing%20tool%20logo)
If I wanted to split the workbook's collection worksheets by fives into workbooks, is that possible? Meaning, If I have 100 worksheets in a
workbook, I want to automate using 5 worksheets at a time to make a workbook, which will end with 20 workbooks being made. How do you
tweak the code to do this?
Reply Share
VBA works. If not - Probable errors root cause: This VBA cannot handle HIDDEN SHEETS or if one of the sheets has the same name with the
workbook.
Reply Share
Hi Gborka,
You can use the Split Workbook feature of Kutools for Excel, which can export hidden worksheets, and export all worksheets no matter
what sheet names are.
Reply Share
Will this VBA work for Mac? It works perfectly for my PC but my manager uses a Mac.
Reply Share
Yes!! I just used it on Mac. However you will need to change some thing. The back slash into front slash /. I have already done it. Copy
paste it. It will work. Let me know if it doesn't.
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
Reply Share Read more
The version vba code is not working right, I have a "macros" file where I keep all my macros and have it open when I'm going to use them, and
I'm running this one in the file that I need to be splitted but it splits the macros file.
Reply Share
Thank you!
Reply Share
I am as well, I have used this several times in the past but it is not working now
Reply Share
1004 error root cause: This VBA cannot handle hidden sheets or if one of the sheets has the same name with the workbook.
Reply Share
Does anyone know how to make this code work for a mac?
It is showing an error when trying to locate the document.
KutoolsReply forShare Excel Solves Most of Your Problems, and Increases Your Productivity By
Dan Turney · 8 months80%. ago Full Features 30-day Free Trial.
i (https://www.addthis.com/website-tools/overview?utm_source=AddThis%20Tools&utm_medium=image&utm_campaign=Marketing%20tool%20logo)
Yes for
Change "\" to "/" worked please!
me. Wow!(https://www.extendoffice.com/download/kutools-for-excel.html)
/
Reply Share
Amazing script and instructions. Just saved me from splitting 30+Worksheets to separate files
Reply Share
Same! This worked perfectly for me. Saved me a lot of effort. Thank you!
Reply Share
I am using the split data into worksheets based on a column with 27 items in that column. The results are 54 worksheets 2 for each item. The
only difference I can see is based on one of the columns in the range. For example:
Once the split has occured, John Doe has 2 worksheets, one named John Doe and another named Sheet32. Each sheet has information for
John Doe, but based on a column "Status" (Billed, Open Order, Salesforce), the information is split. The named worksheet has Billed & Open
Order information and the Sheet32 has Salesforce information.
Reply Share
With the addition of code from comment below it works realy nice.
Reply Share
Sub Splitbook()
'Updateby20140612
Dim xPath As String
Dim Sourcewb As Workbook
Dim Destwb As Workbook
Dim xWs As Worksheet
xPath = Application.ActiveWorkbook.Path
Set Sourcewb = ActiveWorkbook
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.
Reply Share
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?
Reply Share
help ive done this loads of times however today its saying an error on the Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" &
KutoolsReply forShare Excel Solves Most of Your Problems, and Increases Your Productivity By
xWs.Name & ".xlsx" what am i doing wrong
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.
Reply Share
been using this for a while and now having a run time error 1004 then highlighting in yellow line 8 xWs.copy any ideas
please
Reply Share
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?
Reply Share
need a vba code to copy an entire workbook (all tabs) and have files saved based on cell range name by state?
Reply Share
thank you very much www.extendoffice.com (/www.extendoffice.com) . very simple and well define post
Reply Share
Hi, I have a document of 10 sheets, but I only want the same 8 sheets to copy out each time I hit the command button. What changes can I
make to the code (bearing in mind I am a complete amateur in Excel) to get each sheet to adopt the name of the main file, then add the sheet
name at the end?
So as an example the file is called "TESTING" and it has a sheet called "EUROPE". When the macro runs, I want the Europe sheet to be
copied out and called "TESTING - EUROPE.xls".
Reply Share
Hi
The coding works well but I want the header also to come on each and every sheet. As it's skipped the header in all data...
Reply Share
How can I get this .xlsx file to save as .csv when split?
Reply Share
Thank you so much! It worked after I unhid the rest of the workbook. This is awesome!
Reply Share
2 questions.
1. How can you adjust the code the choose the file path of where it is saved? As opposed to just saving wherever the original file is.
2. How do you change the code to choose what column it creates the tabs from (i.e. in this code it is reading out of column A). I want to be
able to choose which column it reads off if. Thanks!
Reply Share
Regards:Jessica
Active consumer on customerso
Reply Share
Hi, i have one quarry i.e. i have 15000 lines of data in one excel sheet and i want to split that data into multiple excel files where as each file
contains 99 lines of data. Anyone can help me. Please share your thoughts.....
Reply Share
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity By
DS · 3 years ago 80%. Full Features 30-day Free Trial.
i (https://www.addthis.com/website-tools/overview?utm_source=AddThis%20Tools&utm_medium=image&utm_campaign=Marketing%20tool%20logo)
The macro should be updated to include an unhide-all-worksheets piece (including the very-hidden worksheets):
Sub UnhideAllSheets()
'Unhide all sheets in workbook.
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
End Sub
Sub Splitbook()
Reply Share Read more
IT SHOULD BE NOTED THAT THE VBA MACRO ABOVE WON'T WORK IF YOU HAVE A HIDDEN EXCEL SHEET, OR A "VERY-HIDDEN"
EXCEL SHEET.
YOU MAY NOT BE AWARE THAT YOU HAVE A "VERY-HIDDEN" EXCEL SHEET. TO CHECK, HIT ALT+F11 TO OPEN MICROSOFT
VISUAL BASIC (MACRO EDITOR). CLICK ON EACH WORKSHEET UNDER THE MICROSOFT EXCEL OBJECTS AND MAKE SURE THAT
THE "Visible" ATTRIBUTE IN THE "Properties" SECTION SHOWS "-1 = xlSheetVisible". IF YOU SPIT AN EXCEL FILE OUT OF ORACLE,
FOR EXAMPLE, YOU'LL SEE A WORKSHEET NAMED "BneLog" with visibility = "2 - xlSheetVeryHidden". This took me forever to figure out,
Reply Share
lol. Hope it helps!
David · 2 years ago
Great tip! I was beating my head against a wall until this occurred to me. I saw previous comments about hidden sheets but until I
realized an existing macro was "very hidden", it didn't make sense to me. On to the next project!
Reply Share
Hi
I'm have master file were data consist for multiple city would like know is their any macros or any formula which keeps this orignal file and also
create & update new workbook city area wise
Reply Share
Hello all,
there are lots of excel sheets and i want it te 1st sheet of it in single work book,
Please Help!!!!
Reply Share
VBA script worked like a charm, got my 80+ new excel files
Reply Share
Hi All,
I've to share the reports to multiple team depending on the brands they work for.
The code works great! is it also possible to save the different tabs as a pdf? I tried but the i can't get it to work :)
Reply Share
The VBA code worked beautifully! It saved me so much time. Thank you for sharing!
Reply Share
Thanks, vba code worked perfectly! Saved me a lot of time splitting a spreadsheet with 25 tabs into different files.
Only thing i picked up is in the 6th last line i changed the file format to new Excel "xlsx"
" & xWs.Name & ".xls" becomes >>>>> " & xWs.Name & ".xlsx"
Reply Share
Thanks for the VBA code!!. It worked perfectly. Saved me much work!!
Reply Share
NG · 4 years ago
Hi there,
Thank you so much for the code, however may how you would add to the code if you wanted the following to happen?
1. What if you wanted Sheet 1 to be copied as well for each additional sheets?
But is it possible to modify it so it saves each worksheet to the same directory(without creating a new folder) based on original file name or
particular Cell Value? Just by adding (1), (2) ets at the end of each exported file.
NG · 4 years ago
Is there a way I can apply the split to many excel files at once? The files have the same 2 sheets (as format and name).
Thank you!
Reply Share
Hello, Thank you; super helpful. I was curious how to edit the save directory. When I run this code, it saves one directory up from the directory
the original file is saved. Can someone please tell me how to make it save to the source file's directory?
Reply Share
I am having data for all the 365 days for 14 year in one excel sheet.
KutoolsNow
for Excel Solves Most of Your Problems, and Increases Your Productivity By
we want to separate the data year wise (Ex. one excel file for year 2002 in that 12 Sheet ie for 12 month and another excel file for year
80%. Full Features 30-day Free Trial.
i (https://www.addthis.com/website-tools/overview?utm_source=AddThis%20Tools&utm_medium=image&utm_campaign=Marketing%20tool%20logo)
2003 in that 12 Sheet ie for 12 month).
Yes please! (https://www.extendoffice.com/download/kutools-for-excel.html)
/
We are able to separate month wise data (by using Excel Kutools - Split Data) and it will create excel sheet for each month (ie it will create
totally 24 sheets) and then we should Split to Workbook and it will be 24 excel file and again we should combine 12 file for each year. This is
taking lot of time.
Now our problem is while splitting the date we want Excel to create Year wise Excel files and in each excel file 12 sheets for 12 months. Can
Reply Share
we do this in same time.
Caroline ·
Please tell us4because we are having lots of data and it is taking lot of time.
years ago
Hi - I have a work sheet with a lot of data that I need to split into separate sheets so I can attach and email to various people. Do you know
how I would go about this? I have a TOTAL cell for each batch of data that I need to split, not all the batches contain the same number of lines.
Any help you can give would be greatly appreciated. Thank you.
Reply Share
1 (https://www.extendoffice.com/documents/excel/628-excel-split-workbook.html?page_comment=1)
2 (https://www.extendoffice.com/documents/excel/628-excel-split-workbook.html?page_comment=2)
(http://www.facebook.com/extendoffice)
(http://twitter.com/intent/follow?source=followbutton&variant=1.0&screen_name=extendoffice)
Copyright © 2009 - 2019 ExtendOffice.com | All Rights Reserved. Sitemap (/support/sitemap.html)
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other
countries.
(https://sectigo.com/trust-seal)
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity By
80%. Full Features 30-day Free Trial.
i (https://www.addthis.com/website-tools/overview?utm_source=AddThis%20Tools&utm_medium=image&utm_campaign=Marketing%20tool%20logo)