跳到主要內容

如何在Excel的單元格中快速插入工作表名稱?

有沒有一種簡單的方法可以將當前工作表的名稱插入一個單元格? 如何在單元格中插入所有工作表的名稱? 本文將為您提供解決這些問題的棘手方法。

使用功能在單元格中快速插入當前工作表名稱

使用VBA將所有工作表名稱快速插入單元格中

使用Kutools for Excel快速插入活動工作表的名稱 好主意3

快速將所有帶有超鏈接的工作表名稱插入單元格中作為索引 好主意3


箭頭藍色右氣泡 使用功能在單元格中快速插入當前工作表名稱

只需輸入公式 = RIGHT(CELL(“ filename”,D2),LEN(CELL(“ filename”,D2))-FIND(“]”,CELL(“ filename”,D2)))) 在任何單元格中,然後按 Enter 鍵,它在單元格中顯示當前工作表的名稱。
doc-insert-sheets-name-to-to-cells1

此公式只能顯示當前工作表的名稱,而不能顯示其他工作表的名稱。


箭頭藍色右氣泡 使用VBA將所有工作表名稱快速插入單元格中

如果要在單元格中插入所有工作表名稱,則VBA宏是一個不錯的選擇。

步驟1:按住 其他 + F11 鍵,然後打開 Microsoft Visual Basic for Applications 窗口。

步驟2:點擊 插入 > 模塊,然後將以下宏粘貼到“模塊窗口”中。

VBA用於在單元格中插入所有工作表的名稱:

Sub SheetNames()
列(1)。插入
對於i = 1 To Sheets.Count
單元格(i,1)=圖紙(i)。名稱
接下來,我
END SUB

步驟3:按下 F5 運行此宏的鍵。 然後,您將在當前工作表的A列中列出所有工作表的名稱。 看截圖:
doc-insert-sheets-name-to-to-cells2

備註:在VBA代碼中,您可以更改 單元格(i,1) 其他參考以插入工作表名稱從其他單元格開始。 例如,插入工作表名稱從C3開始,將其更改為 單元格(i + 2,3).


箭頭藍色右氣泡 使用Kutools for Excel快速插入活動工作表的名稱

如果要將活動工作表的信息(包括工作表名稱,工作簿名稱,文件路徑等)插入到單元格或頁眉/頁腳中,則可以使用 Excel的Kutools插入工作簿信息.

Excel的Kutools, 與以上 300 方便的功能,使您的工作更加輕鬆。 

免費安裝 Kutools for Excel,請執行以下操作:

1.選擇一個單元格或範圍以放置工作表名稱,然後單擊 Kutools 加 > 工作簿 > 插入工作簿信息.doc插入工作表信息1

2.然後選擇您需要從中插入的工作簿信息 資訊 部分,並指定要從中放置信息的位置 插入於 部分。 然後點擊 OK.

doc 1

您可以單擊此處以了解有關插入工作簿信息的更多信息。

箭頭藍色右氣泡 將工作簿信息插入單元格/頁眉/頁腳


箭頭藍色右氣泡 快速將所有帶有超鏈接的工作表名稱插入單元格中作為索引

Excel的Kutools's 創建工作表名稱列表 實用程序不僅將所有工作表名稱插入到單元格中,而且還插入指向相應工作表的超鏈接。

Excel的Kutools, 與以上 300 方便的功能,使您的工作更加輕鬆。 

免費安裝 Kutools for Excel,請執行以下操作:

步驟1:點擊 Kutools 加 > 下載學習單 > 創建工作表名稱列表。
doc-insert-sheets-name-to-to-cells3

步驟2:在 創建工作表名稱列表 對話框,根據需要指定設置,然後單擊 OK.
doc-insert-sheets-name-to-to-cells4

然後,您將看到所有工作表名稱都插入到新的工作表中,並且每個工作表名稱都鏈接到相應的工作表。 請參閱以下屏幕截圖:

帶超鏈接的工作表名稱
帶宏按鈕的工作表名稱
doc-insert-sheets-name-to-to-cells5
doc-insert-sheets-name-to-to-cells6

創建工作表名稱列表 實用程序使您可以輕鬆地在新工作表中創建活動工作簿的所有工作表名稱的列表,其中包含用於快速導航至其他工作表的超鏈接或宏按鈕。 單擊以了解有關此實用程序的更多信息。

箭頭藍色右氣泡 列出所有帶有超鏈接的工作表名稱



Kutools for Excel:您必須在Excel中擁有300多種功能, 從這裡免費試用30天

輕鬆地將多個工作表/工作簿合併為一個工作表或工作簿

在Excel中,將多個工作表或工作簿組合成一個工作表或工作簿可能很麻煩,但是使用 結合 在Kutools for Excel中,您可以將數十個工作表/工作簿合併到一個工作表或工作簿中,也可以通過單擊幾下將工作表合併為一個工作表。  點選取得全功能 30 天免費試用!
合併表
 
Kutools for Excel:擁有300多個便捷的Excel加載項,可以在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 (32)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
how to find the sheet name (section name ) when you type employee no. in a cell? A workbook has 15 sheets named as per sections of the department.In each section has 100 employees in range A2:A101with unique employee no. I have a list of 50 employee nos in different sections. In a new work sheet how to find the section name which corresponds to the employee no.
This comment was minimized by the moderator on the site
Hello, Ashley Pereira, please visit this: https://www.extendoffice.com/documents/excel/5335-excel-vlookup-return-sheet-name.html this article may help you.
This comment was minimized by the moderator on the site
How do you get this formula to copy the tabnames into consecutive columns. In other words not vertically but horizontally.
This comment was minimized by the moderator on the site
Change the following:

Cells(i, 1) = Sheets(i).Name
to
Cells(1, i) = Sheets(i).Name

This causes to step columns in same row.
This comment was minimized by the moderator on the site
you can copy the data entered, then paste Transpose, this converts Cols to Rows, and Rows to Cols.
This comment was minimized by the moderator on the site
Just tried now the macro for inserting all the sheet's name in one sheet. Awesome! Thank you very much
This comment was minimized by the moderator on the site
How do you get the VBA to start in a specific cell instead of A1?
This comment was minimized by the moderator on the site
Just add to i like I did below. If you add to i you can start on any row you would like.

Sub GetNames()

For i = 1 To Sheets.Count

Cells(i + 6, 1) = Sheets(i).Name

Next i
End Sub
This comment was minimized by the moderator on the site
Thank u for your supplement.
This comment was minimized by the moderator on the site
You can change the number in Cells(i, 1) = Sheets(i).Name to other to insert the sheet names in other column, for instance, insert start from C1,change Cells(i, 1) = Sheets(i) to Cells(i, 3) = Sheets(i), but this VBA only can insert the sheet names start from the row 1.
This comment was minimized by the moderator on the site
Thanks!! this was was a great help.
This comment was minimized by the moderator on the site
Hi Kindly i want VBA code to insert file name in specific cell. Thanks
This comment was minimized by the moderator on the site
Great site was very helpful. I have different tab names and I get the names in one sheet using your code, but it gives names of all the tab names, is there anyway we can add code to select from certain tab number or something like that.
This comment was minimized by the moderator on the site
I have multiple project sheets database with different tab name and this name is shown in master sheet table. which formula can i give that when i insert new tab it should automatically updated in master table.
This comment was minimized by the moderator on the site
Can anyone help me with this: Create a macro that creates 10 sheets and name them Sheet1 to Sheet10 but using a loop
This comment was minimized by the moderator on the site
Hello, Can you please help me with the simple VBA code. I have a list of Names in Column A. Specific Range - (A2:A251) - Now I need to create new spreadsheets with these names. The names are driven from a different sheet, thus they keep changing. So in short, if I have 10 names today, they might not appear tomorrow. So on the click of button all older spreadsheets (except 1) should be deleted first and then from the names on the column, new ones should get created. Please advice if this is possible to do? Thanks, Manish Gupta
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