跳到主要内容

如何在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

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!

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

以下VBA代码可以帮助您快速将当前工作簿的多个工作表拆分为单独的Excel文件,请执行以下操作:

1。 为要拆分的工作簿创建一个新文件夹,因为拆分的Excel文件将与该主工作簿保留在同一文件夹中。

2。 按住 ALT + F11 键,然后打开 Microsoft Visual Basic应用程序 窗口。

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 文件

如果你有 Kutools for Excel 安装,其 拆分工作簿 该工具只需单击几下,即可方便快捷地将多个工作表拆分为单独的Excel文件。

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!

1。 安装后 Kutools for Excel,单击“ Kutools 加 > 拆分工作簿 ,请参见屏幕截图:

2。 在 拆分工作簿 对话框中,进行以下操作:
(1)默认情况下检查所有工作表名称。 如果您不想拆分某些工作表,则可以取消选中它们;
(2)检查 保存类型 选项;
(3)从 保存类型 下拉菜单中,选择一种您想要拆分和保存的文件类型。
(4)然后点击 分裂 按钮。

备注:如果要避免拆分隐藏的工作表或空白工作表,可以检查 跳过隐藏的工作表 or 跳过空白工作表 框。

3。 在“浏览文件夹”对话框中,请指定目标文件夹以保存拆分的单独文件,然后单击 OK 按钮。

现在,选中的工作表将另存为新的单独的工作簿。 每个新工作簿均以原始工作表名称命名。 看截图:

Kutools for Excel's 拆分工作簿 该工具使您可以轻松地根据需要将活动工作簿拆分为单独的Excel文件(一个文件包含一个工作表),CSV文件,TXT文件或PDF文件。 您可以设置为跳过所有空白和隐藏的工作表。 免费试用!


演示:将一个工作簿的每个工作表拆分或保存为单独的excel / txt / csv / pdf文件


Kutools for Excel:超过 300 个方便的工具触手可及! 立即开始 30 天免费试用,没有任何功能限制。 立即下载!

相关文章:

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 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