跳到主要內容

如何在Excel中拆分工作簿以分隔Excel文件?

您可能需要將一個大型工作簿拆分為單獨的Excel文件,然後將工作簿的每個工作表另存為單獨的Excel文件。 例如,您可以將工作簿拆分為多個單獨的Excel文件,然後將每個文件交付給不同的人來處理。 這樣,您可以讓某些人處理特定數據,並確保您的數據安全。 本文將介紹根據每個工作表將大型工作簿拆分為單獨的Excel文件的方法。

  1. 拆分工作簿以復制和粘貼分隔Excel文件
  2. 拆分工作簿以使用移動或複制功能分隔Excel文件
  3. 拆分工作簿以使用VBA代碼分隔Excel文件
  4. 使用Kutools for Excel輕鬆拆分工作簿以分離Excel / PDF / CSV / TXT文件

拆分工作簿以復制和粘貼分隔Excel文件

通常,使用 複製 指揮 命令可以手動將工作簿另存為單獨的Excel文件。 首先,選擇要保存為單獨文件的整個工作表,創建一個新工作簿,然後將其粘貼到新工作簿中,最後將其保存。

如果只需要將幾個工作表拆分為單獨的文件,則這是一種易於使用的方法。 但是,通過手動複製和粘貼來拆分許多工作表必須非常耗時且乏味。


拆分工作簿以使用移動或複制功能分隔Excel文件

此方法將引入“移動或複制”功能,以將選定的圖紙移動或複製到新工作簿並另存為單獨的工作簿。 請執行以下操作:

1。 在“工作表”選項卡欄中選擇工作表,右鍵單擊並選擇 移動或複制 從上下文菜單中。 看截圖:

備註:控股 按Ctrl 鍵,您可以選擇多個不相鄰的工作表,方法是在“工作表”標籤欄中逐一單擊它們; 保持 轉移 鍵,您可以通過單擊“工作表”選項卡欄中的第一個和最後一個來選擇多個相鄰的工作表。

2。 在“移動或複制”對話框中,選擇 (新書) 來自 預訂 下拉列表,請檢查 建立副本 選項,然後單擊 OK 按鈕。 看截圖:

3。 現在,所有選定的工作表都被複製到新的工作簿中。 請點擊 文件 > 節省 保存新的工作簿。

快速拆分工作簿以在Excel中分離Excel / PDF / TXT / CSV文件

通常,我們可以使用 移動或複制 Excel中的功能。 但是Kutools for Excel的 拆分工作簿 實用程序可以幫助您輕鬆拆分工作簿並將每個工作表另存為單獨的PDF / TEXT / CSV文件或Excel中的工作簿。


廣告拆分工作簿excel

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

拆分工作簿以使用VBA代碼分隔Excel文件

以下VBA代碼可以幫助您快速將當前工作簿的多個工作表拆分為單獨的Excel文件,請執行以下操作:

1。 為要拆分的工作簿創建一個新文件夾,因為拆分的Excel文件將與該主工作簿保留在同一文件夾中。

2。 按住 ALT + F11 鍵,然後打開 Microsoft Visual Basic for Applications 窗口。

3。 點擊 插入 > 模塊,然後將以下代碼粘貼到“模塊窗口”中。

VBA:將工作簿拆分為多個工作簿並保存在同一文件夾中

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。 按 F5 運行此代碼的關鍵。 然後將工作簿拆分為與原始工作簿在同一文件夾中的單獨Excel文件。 看截圖:

備註:如果其中一張圖紙與工作簿名稱相同,則該VBA無法使用。

使用Kutools for Excel輕鬆拆分工作簿以分離Excel / PDF / CSV / TXT文件

如果你有 Excel的Kutools 安裝,其 拆分工作簿 該工具只需單擊幾下,即可方便快捷地將多個工作表拆分為單獨的Excel文件。

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

1。 安裝後 Excel的Kutools點擊此處成為Trail Hunter Kutools 加 > 拆分工作簿 ,請參見屏幕截圖:

2。 在 拆分工作簿 對話框中,進行以下操作:
(1)默認情況下檢查所有工作表名稱。 如果您不想拆分某些工作表,則可以取消選中它們;
(2)檢查 保存類型 選項;
(3)從 保存類型 下拉菜單中,選擇一種您想要拆分和保存的文件類型。
(4)然後點擊 分裂 按鈕。

備註:如果要避免拆分隱藏的工作表或空白工作表,可以檢查 跳過隱藏的工作表 or 跳過空白工作表 框。

3。 在“瀏覽文件夾”對話框中,請指定目標文件夾以保存拆分的單獨文件,然後單擊 OK 按鈕。

現在,選中的工作表將另存為新的單獨的工作簿。 每個新工作簿均以原始工作表名稱命名。 看截圖:

Excel的Kutools's 拆分工作簿 該工具使您可以輕鬆地根據需要將活動工作簿拆分為單獨的Excel文件(一個文件包含一個工作表),CSV文件,TXT文件或PDF文件。 您可以設置為跳過所有空白和隱藏的工作表。 免費試用!


演示:將一個工作簿的每個工作表拆分或保存為單獨的excel / txt / csv / pdf文件


Excel的Kutools:超過 300 個方便的工具觸手可及! 立即開始 30 天免費試用,沒有任何功能限制。 現在就下載!

相關文章:

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (113)
Rated 2.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Hello.
Both options work fine. But ..not satisfying my needs.
In each sheet i have 2 extra columns at and which contain vlookup formulas. And they all get exported to new files..
I cant have that.I also cant go and delete all formulas from all sheets then export , too much work.
Any solution to export but to ignore those columns with formulas?
Rated 2.5 out of 5
This comment was minimized by the moderator on the site
I tried this in Office 365 and it copies 8 sheets to separate files then gives me "run-time error '1004': Copy Method of Worksheet Class failed"
This comment was minimized by the moderator on the site
Hi there, did you use the vba code or Kutools?
This comment was minimized by the moderator on the site
I was able to use this macro once and it was great but now it will not work and I only get one file labeled as "Sheet 1" and it is blank, can anyone help?
This comment was minimized by the moderator on the site
Hello, how can we split the sheets tow by tow ==< what i mean is that i have an amount of sheets in one folder and I want tow split each tow successive sheets in one folder, i have tried to put changes on the basic code but i didn't succeed, I'm a beginner in this field if you can be held that is going to be a huge help
This comment was minimized by the moderator on the site
xWs.Copy
showing error in this area
This comment was minimized by the moderator on the site
Hello, I just tried the split data function based on the first column (about 90 partners). Half of the worksheets are named correctly while the other just have number of the sheet eventhough there is name of the partner in the column. Any help, please?
This comment was minimized by the moderator on the site
i have a data of 5 worksheets. Every worksheet has a common column (Branch). Can i convert the data into different excel files based on respective branches
This comment was minimized by the moderator on the site
Hi Sudarshan,
Kutools for Excel has an amazing feature – Split Data, which can quickly split data from a range or a sheet to multiple sheets based on values in the specified column. And these sheets are saved in a new workbook.

You can apply the Split Data feature to split each sheet based on the specified common column.
After splitting, you can apply the Combine Worksheets feature, also provided by Kutools for Excel, and combine all same name worksheets into one workbook.
This comment was minimized by the moderator on the site
excel which i want to split is having 3 spread sheet my requirement is to split the excel as per the sheet 1 and remaning to sheet to be contant when file split
This comment was minimized by the moderator on the site
Hi prateeksha,
In the fourth method on this webpage, the Split Workbook feature of Kutools for Excel is recommended, which will split every specified worksheet to individual PDF/CSV/TEXT/Workbooks.
This comment was minimized by the moderator on the site
Hey there,
I was wondering if we can use this macro to split the workbook into csv files
I've changed the VBA as below, replacing "xlsx" with "csv", but it doesn't work:
Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".csv"
Thanks for your help!
This comment was minimized by the moderator on the site
Hi Kevin,
It recommends trying the fourth method to solve your problem. Kutools for Excel can be freely trial for 30 days. And the Split Workbook feature of Kutools for Excel can solve the problem easily.
This comment was minimized by the moderator on the site
Very helpful code. Just had one question. How can I make these excel files read-only. I tried the below but it did not work.

Application.ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations