跳到主要內容

如何在Excel的標題欄或工具欄中顯示文件路徑?

默認情況下,當您打開工作簿時,工作簿名稱將顯示在標題欄中。 但有時,您希望在Excel文件的圖塊欄或工具欄中顯示完整路徑。 有沒有嘗試過自己解決這個問題? 今天,我可以向您介紹一些快速技巧,以在工作簿的標題欄或工具欄中顯示完整的文件路徑。

在Excel的標題欄中顯示完整的文件路徑

在Excel的工具欄中顯示完整的文件路徑


箭頭藍色右氣泡 在Excel的標題欄中顯示完整的文件路徑

在Excel中,沒有直接的方法可以在標題欄中顯示完整路徑,但是您可以應用以下簡單的VBA代碼,方法如下:

1。 按住 ALT + F11 鍵,然後打開 Microsoft Visual Basic for Applications窗口.

2。 點擊 插入 > 模塊,然後將以下代碼粘貼到 模塊窗口.

VBA代碼:在標題欄中顯示完整路徑

子showCaption()ActiveWindow.Caption = ActiveWorkbook.FullName End Sub

3。 然後按 F5 鍵運行該代碼,完整的文件路徑立即顯示在標題欄中。 看截圖:

文檔在標題欄中顯示完整路徑1

注意: 重命名工作簿時,該路徑不會自動更新,您需要重新運行此代碼以更新Excel文件的路徑。


箭頭藍色右氣泡 在Excel的工具欄中顯示完整的文件路徑

如果要在工作簿的工具欄中顯示完整路徑,可以通過以下步驟完成它:

1。 點擊 自定義快速訪問工具欄 > 更多命令,請參見屏幕截圖:

文檔在標題欄中顯示完整路徑1

2。 在 Excel選項 對話框中,選擇 所有的命令 來自 從中選擇命令 下拉列表,然後向下滾動到 文件位置 然後單擊 添加>> 按鈕將此選項添加到 自定義快速訪問工具欄 列錶框,請參見屏幕截圖:

文檔在標題欄中顯示完整路徑1

3。 然後點擊 OK 關閉此對話框,並且完整的文件路徑已顯示在工具欄中,請參見屏幕截圖:

文檔在標題欄中顯示完整路徑1

備註:重命名文件時,此方法也無法自動更新。


相關文章:

如何在Excel頁眉或頁腳中插入上次修改日期?

最佳辦公生產力工具

🤖 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 (6)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
how can i show the file path by default on the bottom of each & every document..help
This comment was minimized by the moderator on the site
I am in Mac OS X 10.13.2. This code results in showing (almost) the entire path, but the file extension is missing. I have searched for how to turn on the file extension in the title bar, but have not found an answer yet. Other answers refer to how to show file extension in the finder window, which I have done successfully. However, Excel 2016 still won't show file extensions in the title banner. Can you please advise how to turn this on?
This comment was minimized by the moderator on the site
In windows OS the file extension will be visible across the OS when Explorer->Tools->Folder Options->View->"Hide extensions for known file types" is unchecked.
In Mac OS you might need this article https://support.apple.com/en-in/guide/mac-help/mchlp2304/mac.
This comment was minimized by the moderator on the site
On Mac OS you can just right-click the file name in the title bar and get the path. That is across the OS and works in almost any application
This comment was minimized by the moderator on the site
I tried running this and it worked the first time I ran it...closed that workbook and opened another went to run it again and got "RUNTIME ERROR 424" it was looking for a object. I have no VBA experience and am perplexed how 3 line of code can be so confusing...any ideas this is the line it was focusing on when I hit debug ActiveWindow.Caption = ActiveWorkbook.FullName
This comment was minimized by the moderator on the site
The QuickToolBar Document.Fullpath Doesn't work as advertised. Is only showing root path. Does not show subfolder it is in. In this case document is on Sharepoint, and all it shows is the domain, which makes this useless.Especially since the way the document is referenced is through a map to the sharepoint. So not showing the local path, and the online path is incomplete
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations