跳到主要内容

如何在Excel中创建工作表名称的动态列表?

如果一个工作簿中有多个工作表,并且要在该工作簿的新工作表中创建所有工作表名称的动态列表,该怎么办? 现在,本教程介绍了一些技巧,可以在Excel中快速完成此任务。

使用定义名称和公式创建工作表名称的动态列表

使用VBA代码创建工作表名称的动态列表

使用 Kutools for Excel 创建工作表名称的动态列表 好主意3

使用 Kutools for Excel 显示工作表名称的动态列表 好主意3


1.在空白工作表中选择一个单元格,在这里我选择A1,然后单击 公式 > 定义名称。 看截图:
文档动态工作表名称-列表-1

2.然后在 新名字 对话框,输入 进入 名字 文本框(您可以根据需要进行更改),然后键入此公式 = SUBSTITUTE(GET.WORKBOOK(1),“ [”&GET.WORKBOOK(16)&“]”,“”) 进入“引用”文本框。 看截图:
文档动态工作表名称-列表-2

3。 点击 OK。 转到所选单元格(A1)并键入此公式 = INDEX(Sheets,ROWS($ A $ 1:$ A1)) (A1是您键入此公式的单元格,“ Sheets”是您在第2步中定义的名称),然后向下拖动自动填充手柄,直到#REF! 出现。
文档动态工作表名称-列表-3

Tips::如果删除或添加了工作表,则需要转到A1并按Enter键,然后再次拉动自动填充手柄。
文档动态工作表名称-列表-4


如果要创建可以链接到每个工作表的工作表名称的动态列表,则可以使用VBA代码。

1.创建一个新的工作表,并将其重命名为Index。 看截图:

文档动态工作表名称-列表-5       文档动态工作表名称-列表-6

2.右键单击索引的工作表名称,选择 查看代码 从上下文菜单中。 看截图:
文档动态工作表名称-列表-7

3.在弹出的窗口中,将下面的VBA代码复制并粘贴到其中。

VBA:创建工作表名称的动态列表。

Private Sub Worksheet_Activate()
	'Updateby20150305
	Dim xSheet As Worksheet
	Dim xRow As Integer
	Dim calcState As Long
	Dim scrUpdateState As Long
	Application.ScreenUpdating = False
	xRow                       = 1
	With Me
		.Columns(1).ClearContents
		.Cells(1, 1) = "INDEX"
		.Cells(1, 1).Name = "Index"
	End With
	For Each xSheet In Application.Worksheets
		If xSheet.Name <> Me.Name Then
			xRow                     = xRow + 1
			With xSheet
				.Range("A1").Name = "Start_" & xSheet.Index
				.Hyperlinks.Add anchor: = .Range("A1"), Address: = "", _
				SubAddress:             = "Index", TextToDisplay: = "Back to Index"
			End With
			Me.Hyperlinks.Add anchor: = Me.Cells(xRow, 1), Address: = "", _
			SubAddress: = "Start_" & xSheet.Index, TextToDisplay: = xSheet.Name
		End If
	Next
	Application.ScreenUpdating = True
End Sub

4。 点击 运行 or F5 要运行VBA,现在将创建工作表名称的动态列表。
文档动态工作表名称-列表-8

提示:

1.当删除或插入工作簿的工作表时,工作表名称列表将自动更改。

2.您可以单击名称列表的工作表名称以转到工作表。

上面的两种方法不够方便,如果您对新实用程序感兴趣,则可以使用下面的两种方法,这可能会使此任务更加容易。


 如果您只想快速列出工作簿的所有工作表名称并将它们链接到原始工作表,则可以使用 Kutools for Excel创建工作表名称列表.

Kutools for Excel, 与超过 300 方便的功能,使您的工作更加轻松。 

免费安装 Kutools for Excel,请执行以下操作:

1。 点击 Kutools 加 > 工作表 > 创建工作表名称列表。 看截图:

doc动态工作表名称17

2.在 创建工作表名称列表 对话:

 doc动态工作表名称列表2
(1)检查您需要的索引样式 工作表索引样式 部分;
(2)通过将数据键入到新索引表中 指定图纸索引的图纸名称 文本框;
(3)指定将添加的索引表放置在目录中的位置。 将工作表索引插入 清单
(4)如果要在单个列表中显示工作表名称,请在 显示工作表索引到 名单。

3。 点击 Ok。 现在您可以看到工作表名称已列出。
doc kutools创建工作表列表3

提示:

1.您可以单击工作表名称以快速切换到其原始工作表。

2.列表或工作表名称不能随插入或删除工作表而动态更改。

3.实际上,您还可以创建一个按钮列表来链接相关的工作表,只需要检查一下即可 包含按钮和宏 在对话框中。 参见screeshshot:
doc kutools创建工作表列表4

单击此处以了解有关创建图纸名称列表的更多信息。


如果你有 Kutools for Excel,您也可以使用 旅游导航 实用程序,以在窗格中显示可链接的工作表名称

免费安装 Kutools for Excel,请执行以下操作:

1。 点击 库工具 > 旅游导航 。 点击 工作簿和工作表 以显示工作簿和工作表,您可以选择一个工作簿,然后其工作表将显示在 旅游导航 窗格。 看截图:
doc导航窗格1   

提示:

当有工作表被删除或添加时,您可以单击 刷新按钮 doc导航窗格2 ,在 导航n窗格刷新工作表名称。

单击此处以获取有关导航的更多信息。

最佳办公生产力工具

🤖 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 (13)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hallo. hoe zou ik dit kunnen doen om hetzelfde te doen maar met een welbepaade cel van verschillende werkbladen. Bv. een leeg tabblad. mijn andere werkbladen hebben allemaal dezelfde lay-out, maar in iedere cel een andere tekst. Nu zou ik graag in mijn leeg tabblad in Cel A1 de gegevens terugvinden van tabblad1 cel B3. Maar dan zou ik graag in Cel A2 de gegevens terugvinden van tabblad 2 cel 3. En zou naar beneden en dit in een beweging. We kunnen allemaal afzonderlijk doen, maar als er 500 werkbladen zijn, is dit onmogelijk.

Merci voor den input.
This comment was minimized by the moderator on the site
Hi, I guess you want to list all same cells across multiple sheets, if so, there are two tutorials may help you. Please visit:
How to reference same cell from multiple worksheets in Excel?
How to create a list from same cells across multiple sheets in Excel?
Hope it is helpful.
This comment was minimized by the moderator on the site
Em português brasileiro, GET.WORKBOOK é identificado como uma função no Gerenciador de Nomes para criar o nome "Sheets", mas ao referenciar "Sheets" numa célula, aparece o erro "#NOME?". Tentei várias vezes, inclusive com a sugestão de traduzir GET.WORKBOOK para OBTER.LIVRO mas não funcionou.
This comment was minimized by the moderator on the site
Hi, try this: =SUBSTITUIR(INFO.PASTA.TRABALHO(1),"["&INFO.PASTA.TRABALHO(16)&"]","")
This comment was minimized by the moderator on the site
Thanks for this helpful info. I created a dynamic list with VBA code in the Index tab. I found that it only updates when I click back to the Index tab, though. Is there a way to ensure it auto updates as soon as a new tab is created? I refer to the tab names elsewhere in the workbook and others will be using it so I'm trying to make it seamless. Thank you!
This comment was minimized by the moderator on the site
Sorry, I do not find that code can finish your job.
This comment was minimized by the moderator on the site
Or you can simply rightClick either the left or right tab-horizontal-scroll arrow at the bottomLeft, and then click the worksheet name (from the simple vertical list) that you want to jump to.
This comment was minimized by the moderator on the site
Just what I needed and worked perfectly. Thank you!
This comment was minimized by the moderator on the site
Defining the name "Sheets" in the define name DOES NOT WORK. The "refers to" box will not save the formula as typed and converts it to a text string.
This comment was minimized by the moderator on the site
how can I use this code to create the list of worksheets in horizontal order instead of vertical? is it possible?
This comment was minimized by the moderator on the site
Thank you. It is very useful. :D
This comment was minimized by the moderator on the site
How can i remove the links to each sheets and how to not include the "sheet1" and "Index" sheet? Private Sub Worksheet_Activate() 'Updateby20150305 Dim xSheet As Worksheet Dim xRow As Integer Dim calcState As Long Dim scrUpdateState As Long Application.ScreenUpdating = False xRow = 1 With Me .Columns(1).ClearContents .Cells(1, 1) = "INDEX" .Cells(1, 1).Name = "Index" End With For Each xSheet In Application.Worksheets If xSheet.Name Me.Name Then xRow = xRow + 1 With xSheet .Range("A1").Name = "Start_" & xSheet.Index .Hyperlinks.Add anchor: = .Range("A1"), Address: = "", _ SubAddress: = "Index", TextToDisplay: = "Back to Index" End With Me.Hyperlinks.Add anchor: = Me.Cells(xRow, 1), Address: = "", _ SubAddress: = "Start_" & xSheet.Index, TextToDisplay: = xSheet.Name End If Next Application.ScreenUpdating = True End Sub
This comment was minimized by the moderator on the site
How would I go about editing this code to include a checkbox to the left of the link that I could use to hide rows on a cover sheet? Also how could I insert a row on the worksheets below A1 to have the return to index link show up there?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations