跳到主要內容

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

尖端:如果刪除或添加了工作表,則需要轉到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.您可以單擊名稱列表的工作表名稱以轉到工作表。

上面的兩種方法不夠方便,如果您對新實用程序感興趣,則可以使用以下兩種方法,這可能會使此任務更加容易。


 如果只想快速列出工作簿的所有工作表名稱並將其鏈接到原始工作表,則可以使用 Excel的Kutools創建工作表名稱列表.

Excel的Kutools, 與以上 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

單擊此處以了解有關創建圖紙名稱列表的更多信息。


如果你有 Excel的Kutools,您也可以使用 導航 在窗格中顯示可鏈接工作表名稱的實用程序

免費安裝 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選項卡為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