跳到主要内容

如何从Excel中的一系列单元格创建序列工作表?

如果您的工作表中有一系列数据,现在,您想基于单元格数据创建一系列工作表,请参见以下屏幕截图。 当然,您可以手动一个接一个地编辑工作表名称,但是如果需要编辑多个工作表名称,这种方式将很麻烦且耗时。 在这里,我将讨论一些可以帮助您的快速技巧。

文档从列表1创建工作表

使用VBA代码从单元格列表中创建序列工作表

使用 Kutools for Excel 从单元格列表创建序列工作表


箭头蓝色右气泡 使用VBA代码从单元格列表中创建序列工作表

下面的VBA代码可以帮助您添加一些工作表,这些工作表是根据现有工作表之后的单元格内容命名的。 请这样做:

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

2。 点击 插页 > 模块,然后将以下代码粘贴到 模块窗口.

VBA代码:根据单元格列表添加序列工作表

Sub CreateWorkSheetByRange()
'Update 20130829
Dim WorkRng As Range
Dim Ws As Worksheet
Dim arr As Variant
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
arr = WorkRng.Value
Application.ScreenUpdating = False
For i = 1 To UBound(arr, 1)
    For j = 1 To UBound(arr, 2)
        Set Ws = Worksheets.Add(after:=Application.ActiveSheet)
        Ws.Name = arr(i, j)
    Next
Next
Application.ScreenUpdating = True
End Sub

3。 然后按 F5 键运行此代码,然后会弹出一个提示框,供您选择要使用的范围。 看截图:

文档从列表2创建工作表

4。 然后点击 OK,在现有工作表之后添加了由单元格值命名的工作表。 看截图:

文档从列表3创建工作表

笔记:

1.新工作表将插入到当前工作表之后。

2.如果所选范围包括空白单元格,则根据默认名称命名工作表。 查看屏幕截图:

文档从列表4创建工作表
-1
文档从列表5创建工作表

箭头蓝色右气泡 使用 Kutools for Excel 从单元格列表创建序列工作表

在这里,我介绍一个方便的工具-Kutools for Excel,其 创建序列工作表,您可以使用月名称,日名称,自定义列表等快速创建工作表。

Kutools for Excel 包括300多个便捷的Excel工具。 30天免费试用,不受限制。 立即获取.

安装 Kutools for Excel 后,请执行以下步骤:

1。 选择要基于其创建工作表的范围。

2. 点击 企业 > 工作表工具 > 创建序列工作表,请参见屏幕截图:

文档从列表6创建工作表

3。 在 创建序列工作表 对话框中,选择要创建新序列工作表的工作表类型,然后检查 范围内的数据 选项,请参见屏幕截图:

文档从列表7创建工作表

4。 然后点击 OK 关闭对话框,并创建一个包含工作表的新工作簿,该工作簿由选定的范围数据命名。 看截图:

文档从列表8创建工作表

笔记:

1.如果您选择工作表1或工作表2,创建的新工作表的格式将与工作表1或工作表2的格式相同。

2.新的工作表在新的工作簿中创建。

3.如果所选范围包括空白单元格,则根据默认名称命名工作表。 查看屏幕截图:

文档从列表9创建工作表
-1
文档从列表10创建工作表

单击以了解有关此创建序列工作表功能的更多信息。


相关文章:

如何在Excel中添加具有自定义名称的新工作表?

最佳办公生产力工具

🤖 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 (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How to add bydefault table with row name and column name on sheets after creating sheets using command button. Please help.
This comment was minimized by the moderator on the site
How can the code be modified to copy a worksheet labeled "Template" and rename it to the values in the list selected in the range? I tried modifying the "worksheets.Add" code to "Worksheets("Template").Copy but it just makes copies with the worksheets labeled "Template(1)", "Template(2)", etc. Also, is there a way to put the tabs in numerical order as they are added?
This comment was minimized by the moderator on the site
Hi, Would it be possible to set-up a template for the new sheets created, instead of blank worksheets. Thanks Dave
This comment was minimized by the moderator on the site
Hi, I want to create invoices using excel and need to know whether is there a way to auto generate the second continuation page when the items on the first page exceed the A4 page layout that I have predefined? Any help is appreciated.
This comment was minimized by the moderator on the site
Could you modify the VBA code so that if the worksheet exists, it is skipped over? As it exists now, running the code a second time on the same range will create numbered worksheets. Thanks! Chris
This comment was minimized by the moderator on the site
Hello, Can I exclude blanks and automatically copy data with is behind the name? This data is generated from a pivot and I want to have all the names in different tabs with the data behind it in the layout. name1 data data data blank data data data blank Name 2 Thanks!
This comment was minimized by the moderator on the site
I need to duplicate one sheet when making all these new sheets from a list. Can you add the code for that? Thanks!
This comment was minimized by the moderator on the site
You can right click the tab and choose "move or copy" to duplicate it.
This comment was minimized by the moderator on the site
Very useful. thank you
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations