跳到主要內容

如何在Excel單元格中引用選項卡名稱?

要在Excel單元格中引用當前工作表標籤名稱,可以使用公式或用戶定義函數來完成。 本教程將指導您完成以下操作。

使用公式引用單元格中的當前工作表標籤名稱
使用用戶定義功能在單元格中引用當前工作表標籤名稱
使用Kutools for Excel輕鬆引用單元格中的當前工作表標籤名稱


使用公式引用單元格中的當前工作表標籤名稱

請執行以下操作,以在Excel中的特定單元格中引用活動工作表標籤的名稱。

1.選擇一個空白單元格,複製並粘貼公式 = MID(CELL(“ filename”,A1),FIND(“]”,CELL(“ filename”,A1))+ 1,255) 進入公式欄,然後按 Enter 鍵。 看截圖:

現在,工作表標籤名稱在單元格中被引用。

在工作表中的特定單元格,頁眉或頁腳中輕鬆插入標籤頁名稱:

Excel的Kutools's 插入工作簿信息 實用程序可幫助輕鬆地將活動選項卡名稱插入特定的單元格。 此外,您可以根據需要將工作簿名稱,工作簿路徑,用戶名等引用到單元格,工作表的頁眉或頁腳中。 點擊查看更多細節。
立即下載 Kutools for Excel! (30 天免費試用)


使用用戶定義功能在單元格中引用當前工作表標籤名稱

除上述方法外,您還可以使用“用戶定義功能”在單元格中引用工作表標籤名稱。

1。 按 其他 + F11 打開 Microsoft Visual Basic for Applications 窗口。

2。 在裡面 Microsoft Visual Basic for Applications 窗口中,單擊 插入 > 模塊。 看截圖:

3.將以下代碼複製並粘貼到“代碼”窗口中。 然後按 其他 + Q 關閉鍵 Microsoft Visual Basic for Applications 窗口。

VBA代碼:參考標籤名稱

Function TabName()
  TabName = ActiveSheet.Name
End Function

4.轉到要引用當前工作表標籤名稱的單元格,請輸入 = TabName() 然後按下 Enter 鍵。 然後,當前工作表標籤名稱將顯示在單元格中。


使用Kutools for Excel引用單元格中的當前工作表標籤名稱

隨著 插入工作簿信息 的效用 Excel的Kutools,您可以在所需的任何單元格中輕鬆引用工作表標籤名稱。 請執行以下操作。

1。 點擊 Kutools 加 > 工作簿 > 插入工作簿信息。 看截圖:

2。 在裡面 插入工作簿信息 對話框中選擇 工作表名稱 ,在 資訊 部分,並在 插入於 部分,選擇 範圍 選項,然後選擇一個空白單元格以查找工作表名稱,最後單擊 OK 按鈕。

您可以看到當前工作表名稱已引用到所選單元格中。 看截圖:

  如果您想免費試用(30天)此實用程序, 請點擊下載,然後按照上述步驟進行操作。


演示:使用Kutools for Excel輕鬆引用單元格中的當前工作表標籤名稱

Excel的Kutools 包括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 (24)
Rated 0.5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
sorry your formulas and everything are incorrect on this page.
after direct copy/paste your THEORIES were WRONG
ZERO OUT OF TWO ATTEMPTS WORKED USING YOUR SUGGESTIONS
Rated 0.5 out of 5
This comment was minimized by the moderator on the site
Hi Julia,
What kind of erro did you get?
To be mentioned, the formula provided in the post can only be applied in English system environment Excel. If you have Excel in a different language than English, please convert the formula from English to the language you are currently using.
You can translate the formula in this page: https://de.excel-translator.de/translator/
This comment was minimized by the moderator on the site
The formula at the top won't work until you save the file to your hard drive.
This comment was minimized by the moderator on the site
If you're using Excel Online. I found a solution for this issue.

You need to use 2 cells to make it work. As long as you have a cell that has the reference of a tab in its name, you can use FORMULATEXT() to turn that cells formula into a string and then extract the name that way. I can't imagine a scenario where you will want to reference another sheet and you wont already have a cell referencing that sheet for information on it, but you can always just make a blank/hidden (however you want to do it) cell that is just referencing the other sheet to set this formula up. In the below example, it is referencing cell B1 and cell B1 just contains =Sheet2!A1 as a reference to the sheet I want to name. If you use a name for a sheet with a space in it (example: Sheet 1) it would show up as (='Sheet 1'A1). I used an IF function and an ISERROR function to search if the string contains a space or not and two MID functions to extract the name of the sheet from both scenarios. If you update the name of the referenced sheet, cell B1 will change its formula and subsequently change the string and output the correct name each time.

=IF(ISERROR(FIND(" ",FORMULATEXT(B1))),MID(FORMULATEXT(B1),2,FIND("!",FORMULATEXT(B1))-2),MID(FORMULATEXT(B1),3,FIND("!",FORMULATEXT(B1))-4))
This comment was minimized by the moderator on the site
If you're using Excel Online. I found a solution for this issue.

You need to use 2 cells to make it work. As long as you have a cell that has the reference of a tab in its name, you can use FORMULATEXT() to turn that cells formula into a string and then extract the name that way. I can't imagine a scenario where you will want to reference another sheet and you wont already have a cell referencing that sheet for information on it, but you can always just make a blank/hidden (however you want to do it) cell that is just referencing the other sheet to set this formula up. In the below example, it is referencing cell B1 and cell B1 just contains =Sheet2!A1 as a reference to the sheet I want to name. If you use a name for a sheet with a space in it (example: Sheet 1) it would show up as (='Sheet 1'A1). I used an IF function and an ISERROR function to search if the string contains a space or not and two MID functions to extract the name of the sheet from both scenarios. If you update the name of the referenced sheet, cell B1 will change its formula and subsequently change the string and output the correct name each time.

=IF(ISERROR(FIND(" ",FORMULATEXT(B1))),MID(FORMULATEXT(B1),2,FIND("!",FORMULATEXT(B1))-2),MID(FORMULATEXT(B1),3,FIND("!",FORMULATEXT(B1))-4))
This comment was minimized by the moderator on the site
What I really want is to name some tabs using with the names on some cells from another sheet (same document of course). How can I do that?
This comment was minimized by the moderator on the site
Hi, I used the above suggestions but the first formula to reference the tab sheet name will not work on "excel" online. The second works, but the "Tabname" keeps showing the same tab name for all tabs on the workbook.
This comment was minimized by the moderator on the site
Hi,
Sorry we didn't test in excel online. Can't help you with that yet. Thank you for your comment.
This comment was minimized by the moderator on the site
hello, i am having trouble referencing a sheet name into a cell with online excel
This comment was minimized by the moderator on the site
Excellent, thanks! Per: Reference the current sheet tab name in cell with formula
This comment was minimized by the moderator on the site
Sorry, the comment line is wrong - should be Ctrl-Alt-Shift-F9
This comment was minimized by the moderator on the site
FYI, you need to have more than one sheet in your workbook for this to work. Otherwise, the formula will display the filename but no sheet name.
This comment was minimized by the moderator on the site
Good Day,
Thank you for your comment. I have tested the formula in a workbook that has only one sheet, but everything was running smoothly. The formula only displays the sheet name no matter how many worksheets existing in a workbook.
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