跳到主要內容

如何在Excel中快速列出所有超鏈接?

當使用工作表時,也許我們在其中創建了許多超鏈接,有時我們需要知道文本鏈接到的位置。 如果您一一點擊它們,這將很繁瑣且耗時。 如果我們可以在工作表中列出所有帶有文本和超鏈接地址的超鏈接,那麼我們很容易在Excel中檢查所有超鏈接。

列出所有帶有VBA代碼的選定超鏈接

使用Kutools for Excel從超鏈接中提取所有實際地址


箭頭藍色右氣泡 列出所有帶有VBA代碼的選定超鏈接

1。 選擇包含要列出的超鏈接的範圍。

2。 點擊 開發者 >Visual Basic中,一個新的 適用於應用程序的Microsoft Visual Basic 將顯示一個窗口,單擊 插入>模塊,然後將以下代碼輸入到模塊中:

Option Explicit
Private Function GetHyperAddy(Cell As Range) As String
On Error Resume Next
GetHyperAddy = Cell.Hyperlinks.Item(1).Address
If Err.Number <> 0 Then GetHyperAddy = "None"
On Error GoTo 0
End Function
Sub DistillHyperlinks()
Dim HyperAddy As String, cl As Range, wsTarget As Worksheet, clSource As Range
Application.ScreenUpdating = False
Set clSource = Selection
On Error Resume Next
Set wsTarget = Sheets("Hyperlink List")
If Err.Number <> 0 Then 
Set wsTarget = Worksheets.Add
With wsTarget
.Name = "Hyperlink List"
With .Range("A1")
.Value = "Location"
.ColumnWidth = 20
.Font.Bold = True
End With
With .Range("B1")
.Value = "Displayed Text"
.ColumnWidth = 25
.Font.Bold = True
End With
With .Range("C1")
.Value = "Hyperlink Target"
.ColumnWidth = 40
.Font.Bold = True
End With
End With
Set wsTarget = Sheets("Hyperlink List")
End If
On Error GoTo 0
For Each cl In clSource
HyperAddy = GetHyperAddy(cl)
If Not HyperAddy = "None" Then
With wsTarget.Range("A65536").End(xlUp).Offset(1, 0)
.Parent.Hyperlinks.Add Anchor:=.Offset(0, 0), _
Address:="", SubAddress:=(cl.Parent.Name) & "!" & (cl.Address)
.Offset(0, 1).Value = cl.Text
.Hyperlinks.Add Anchor:=.Offset(0, 2), Address:=HyperAddy
End With
End If
Next cl
wsTarget.Select
End Sub

3。 然後點擊 文檔乘法計算 3 按鈕運行代碼。 並且所有超鏈接都將顯示在名為 超鏈接列表。 看截圖:

文檔列表所有超鏈接


箭頭藍色右氣泡 使用Kutools for Excel從超鏈接中提取所有實際地址

隨著 Excel的Kutools轉換超鏈接 功能,您可以快速從超鏈接中提取真實地址。

Excel的Kutools : 帶有300多個便捷的Excel加載項,可以在30天內免費試用. 

安裝後 Excel的Kutools,請執行以下操作: 立即免費下載Kutools for Excel )

1。 選擇您要提取真實目標的超鏈接。

2。 然後點擊 庫工具 > Link > 轉換超鏈接,請參見屏幕截圖:

3。 在 轉換超鏈接 對話框中選擇 超鏈接地址替換單元格內容 選項從 轉換類型 部分,然後指定要在其中放置結果的單元格 結果範圍 部分,請參見屏幕截圖:

文檔列表所有超鏈接

4。 然後點擊 OK 按鈕,已從超鏈接中提取所有真實地址,請參見屏幕截圖:

文檔列表所有超鏈接

備註: 轉換來源範圍:如果選中此選項,則提取的結果將位於原始單元格範圍內。

立即免費下載Kutools for Excel


相關文章:

如何快速刪除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
seems you forgot to tell folks to select a range. if I select a range of cells it creates the list, otherwise I get an empty list like yael did.
This comment was minimized by the moderator on the site
This was a life saver. For anyone looking to have the hyperlink display where documents are stored on a network path, this should work for you. I didn't select anything, followed the steps, and it created a new sheet with the links expanded which I was able to turn into plain text and use as raw data.
This comment was minimized by the moderator on the site
Hi, It seems that the address selection applies to only web pages and not to other places in the document. - SH
This comment was minimized by the moderator on the site
This is awesome! Is there a way to show the full path? It seems to be truncating the file path a little.
This comment was minimized by the moderator on the site
this is a treasure!!! thank you
This comment was minimized by the moderator on the site
It does not work. Just empty page created
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations