Skip to main content

如何快速列出 Excel 中的所有超連結?

Author: Xiaoyang Last Modified: 2025-05-12

當我們使用工作表時,可能在其中創建了許多超連結,有時候我們需要知道文字鏈接到哪裡。如果逐一單擊它們,將會非常繁瑣且耗時。如果我們能在工作表中列出所有帶有文字和超連結地址的超連結,那麼檢查 Excel 中的所有超連結將變得輕鬆容易。

使用 VBA 程式碼列出所有選定的超連結

使用 Kutools for Excel 提取所有實際地址的超連結


arrow blue right bubble 使用 VBA 程式碼列出所有選定的超連結

1. 選擇包含您要列出的超連結的區域。

2. 點擊 開發工具 > Visual Basic,將彈出一個新的 Microsoft Visual Basic for Applications 視窗,然後點擊 插入 > 模組,並將以下程式碼輸入到模組中:

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然後點擊 Run button 按鈕來執行該程式碼。所有的超連結將顯示在名為 超連結列表的新工作表中。請參見截圖:

A screenshot showing a list of hyperlinks displayed in a new worksheet in Excel


arrow blue right bubble 使用 Kutools for Excel 提取所有實際地址的超連結

通過 Kutools for Excel轉換超鏈接 功能,您可以快速從超連結中提取實際地址。

Kutools for Excel 提供超過 300 種進階功能,簡化複雜任務,提升創造力與效率。 結合 AI 能力,Kutools 能夠精準自動化任務,讓數據管理變得輕而易舉。Kutools for Excel 的詳細資訊...免費試用...

1. 選擇您想提取真實目的地的超連結。

2. 然後點擊 Kutools > 連結 > 轉換超鏈接,請參見截圖:

A screenshot showing the Convert Hyperlinks option in Kutools tab on the ribbon

3. 在 轉換超鏈接 對話框中,從 轉換類型 區域選擇 超鏈接地址替換儲存格內容 選項,然後在 結果範圍 區域指定一個儲存格以放置結果,請參見截圖:

A screenshot of the Convert Hyperlinks dialog box

4. 然後點擊 確定 按鈕,所有真實地址都已從超連結中提取出來,請參見截圖:

A screenshot showing extracted hyperlink addresses in Excel using Kutools

備註轉換來源區域:如果您勾選此選項,提取的結果將位於原始儲存格範圍內。

Kutools for Excel - 超過 300 種必備工具,讓 Excel 功能更強大。永久免費享受 AI 功能!立即獲取


相關文章:

如何快速刪除 Excel 中的所有超連結?

最佳辦公效率工具

🤖 Kutools AI 助手:基於智能執行方式革新數據分析:智能執行   |  生成代碼  |  創建自訂公式  |  分析數據並生成圖表  |  調用 Kutools 函數
熱門功能查找、標記重複值或識別重複項   |  刪除空行   |  合併列或單元格而不丟失數據   |   四捨五入無需公式 ...
高級 LOOKUP多條件 VLookup    多值 VLookup  |   多表查找   |   模糊查找 ....
高級下拉列表快速創建下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
列管理器添加特定數量的列  |  移動列  |  切換隱藏列的可見狀態  |  比較區域和列 ...
特色功能網格聚焦   |  設計檢視   |   增強編輯欄    工作簿與工作表管理器   |  資源庫(自動文本)   |  日期提取器   |  合併資料   |  加密/解密儲存格    按列表發送電子郵件   |  超級篩選   |   特殊篩選(篩選粗體/斜體/刪除線...) ...
頂級 15 種工具集12 個文本工具添加文本刪除特定字符、...)   |   50+ 圖表 類型甘特圖、...)   |   40+ 實用 公式基於生日計算年齡、...)   |   19 個插入工具插入QR碼根據路徑插入圖片、...)   |   12 個轉換工具金額轉大寫匯率轉換、...)   |   7 個合併與分割工具高級合併行分割儲存格、...)   |   ... 還有更多

使用 Kutools for Excel 提升您的 Excel 技巧,體驗前所未有的高效。 Kutools for Excel 提供超過 300 種高級功能來提高生產力並節省時間。  點擊這裡獲取您最需要的功能...


Office Tab 將標籤式界面帶到 Office,讓您的工作更加輕鬆

  • 在 Word、Excel、PowerPoint、Publisher、Access、Visio 和 Project 中啟用標籤式編輯和閱讀。
  • 在同一窗口的新標籤中打開和創建多個文檔,而不是在新窗口中。
  • 將您的生產力提高 50%,每天為您減少數百次鼠標點擊!