提示:其他語言是Google翻譯的。 你可以訪問 English 版本。
登入
x
or
x
x
註冊
x

or

如何從Excel中的超鏈接提取實際的地址?

假設您有一系列包含超鏈接的單元格,現在您需要查看超鏈接的實際目標並從超鏈接中提取它們,如下圖所示。 有沒有簡單的方法可以快速解決這個問題? 本文將指導您從多個超鏈接中提取實際地址。


從超鏈接中提取實際地址:

Kutools for Excel轉換超鏈接 功能,您可以快速從超鏈接中提取真實的URL地址,同時,您還可以將URL文本轉換為可點擊的超鏈接。

doc更改超鏈接瀏覽器6

Kutools for Excel:比200方便的Excel加載項,可以在60天免費試用。 下載並免費試用現在!


箭頭藍色右泡 使用編輯超鏈接功能從超鏈接中提取實際地址


在這裡, 編輯超鏈接 函數可以幫助您為每個超鏈接提取底層URL,並將該實際地址放入不同的單元格中。 你可以這樣做:

1。 選擇超鏈接的單元格並右鍵單擊,從上下文菜單中選擇 編輯超鏈接,看截圖:

2。 和 編輯超鏈接 對話框將出現,選擇並複制(按Ctrl + C)整個網址 地址 對話框的字段。

3。 然後關閉對話框並將實際地址粘貼到您想要的任何單元格中。

注意:使用此方法,每次只能提取一個超鏈接地址,但如果需要提取多個超鏈接,則需要重複應用此功能。


一次刪除所選範圍,工作表或整個工作簿的所有超鏈接:

Kutools for Excel's 刪除超鏈接 功能,您可以根據需要從所選範圍,工作表或整個工作簿中刪除所有超鏈接。

doc刪除超鏈接4


箭頭藍色右泡 使用VBA代碼從超鏈接中提取實際地址

對於很多超鏈接,上面的方法將是乏味和耗時的,所以下面的VBA代碼可以幫助您快速從超鏈接中一次提取多個地址。

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

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

Sub Extracthyperlinks()
'Updateby20140318
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
    If Rng.Hyperlinks.Count > 0 Then
        Rng.Value = Rng.Hyperlinks.Item(1).Address
    End If
Next
End Sub

3。 然後按 F5 鍵來運行代碼,並彈出一個對話框供您選擇想要提取真實地址的超鏈接,請參見屏幕截圖:

4。 然後點擊 OK,並且選定的單元格內容已被轉換為原始範圍中的真實超鏈接地址。 查看屏幕截圖:


箭頭藍色右泡 使用用戶定義功能從超鏈接中提取實際地址

以下用戶定義函數也可以從超鏈接中提取實際的URl。

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

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

Function GetURL(pWorkRng As Range) As String
'Updateby20140520
    GetURL = pWorkRng.Hyperlinks(1).Address
End Function

3。 保存代碼並關閉窗口,選擇一個空白單元格以輸入此公式 =的GetURL(A2) (A2 是超鏈接的單元格),然後按 輸入 按鈕。 你可以看到真正的超鏈接地址被提取。


箭頭藍色右泡 快速,輕鬆地從Kutools for Excel的超鏈接中提取實際地址

這是一個方便的工具,叫 Kutools for Excel,其 轉換超鏈接 功能,您可以快速處理以下操作:

  • 從超鏈接中提取實際地址;
  • 將網址文字轉換為可點擊的超鏈接.
Kutools for Excel : 與超過300方便的Excel加載項,在60天免費試用沒有限制.

如果你已經安裝 Kutools for Excel請按照以下步驟進行:

1。 選擇包含需要提取的超鏈接的範圍。

2。 點擊 Kutools > 鏈接 > 轉換超鏈接,看截圖:

3。 在 轉換超鏈接 對話框中選擇 超鏈接地址替換單元格內容 選項,然後單擊 DOC-button1 按鈕 結果範圍 指定一個單元格來放置結果。

4。 然後點擊 OK,實際地址已從超鏈接中提取。 看截圖:

注意:如果你想把實際的地址放在原來的範圍內,請檢查 轉換源範圍.

點擊 轉換超鏈接 了解更多關於這個功能。

立即下載並免費試用Kutools for Excel!


箭頭藍色右泡 演示:使用Kutools for Excel從超鏈接中提取實際地址

Kutools for Excel:比200方便的Excel加載項,可以在60天免費試用。 下載並免費試用現在!


相關文章:

如何將網址文本轉換為Excel中的可點擊超鏈接?


Kutools for Excel解決了您的大多數問題,並使您的生產率提高了80%

  • 重用: 快速插入 複雜的公式,圖表 以及你以前用過的任何東西; 加密單元格 密碼; 創建郵件列表 並發送電子郵件...
  • 超級方程式酒吧 (輕鬆編輯多行文字和公式); 閱讀佈局 (輕鬆讀取和編輯大量單元格); 粘貼到過濾範圍...
  • 合併單元格/行/列 不丟失數據; 分裂細胞含量; 組合重複的行/列...防止重複的細胞; 比較範圍...
  • 選擇複製或唯一 行; 選擇空行 (所有細胞都是空的); 超級查找和模糊查找 在許多工作簿中; 隨機選擇......
  • 精確複製 多個單元格而不更改公式參考; 自動創建參考 多張表; 插入項目符號,複選框等等......
  • 提取文本,添加文本,按位置刪除, 刪除空間; 創建和打印分頁小計; 在單元格內容和註釋之間轉換...
  • 超級過濾器 (將過濾方案保存並應用到其他工作表); 高級排序 按月/週/日,頻率等; 特殊過濾器 用粗體,斜體......
  • 結合工作簿和工作表; 根據鍵列合併表; 將數據拆分為多個表格; 批量轉換xls,xlsx和PDF...
  • 超過300強大的功能。 支持Office / Excel 2007-2019和365。 支持所有語言。 在您的企業或組織中輕鬆部署。 全功能30天免費試用。
kte tab 201905

Office選項卡為Office提供選項卡式界面,使您的工作更輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,Publisher,Access,Visio和Project。
  • 在同一窗口的新選項卡中打開並創建多個文檔,而不是在新窗口中。
  • 通過50%提高您的工作效率,每天為您減少數百次鼠標點擊!
官方底部
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Arvid Podsim · 1 years ago
    Trying to save time creating multiple Hyperlinks and hoped this program would help with the task. I have combined several columns containing text into a single cell and then used the Edit/Link to create a working URL. Is there a tool to modify the URL to display text characters of the URL.
  • To post as a guest, your comment is unpublished.
    sujan maharjan · 1 years ago
    Hi, How to do the same in google sheets
    • To post as a guest, your comment is unpublished.
      skyyang · 1 years ago
      hello, sujan,
      To extract all real addresses from hyperlinks in Google sheets, the following script code can help you:

      function linkURL(reference) {
      var sheet = SpreadsheetApp.getActiveSheet();
      var formula = SpreadsheetApp.getActiveRange().getFormula();
      var args = formula.match(/=\w+\((.*)\)/i);
      try {
      var range = sheet.getRange(args[1]);
      }
      catch(e) {
      throw new Error(args[1] + ' is not a valid range');
      }
      var formulas = range.getFormulas();
      var output = [];
      for (var i = 0; i < formulas.length; i++) {
      var row = [];
      for (var j = 0; j < formulas[0].length; j++) {
      var url = formulas[i][j].match(/=hyperlink\("([^"]+)"/i);
      row.push(url ? url[1] : '');
      }
      output.push(row);
      }
      return output
      }

      After copying and pasting the above code, go back to your sheet, and apply this formula:=linkURL(A2).
      Please try it, hope it can help you, thank you!
  • To post as a guest, your comment is unpublished.
    Victor Nieto · 1 years ago
    Thanks!!!!!
  • To post as a guest, your comment is unpublished.
    Neeks · 1 years ago
    Ah, amazing! Thank you!
  • To post as a guest, your comment is unpublished.
    sei · 2 years ago
    pretty..and nice...and fantabulouslyfntastikittilybumpershumperazardubiliousipaparazziastically yummy :P
    huh!
  • To post as a guest, your comment is unpublished.
    Stephanie · 2 years ago
    You have no idea how much time you saved me!!!
    Thank you so much!!!!!!!!!!!!!!!!!!!
  • To post as a guest, your comment is unpublished.
    Seocheckout.com · 3 years ago
    Very nice tool! I converted 16K+ links. Tool worked fast and flawless.
  • To post as a guest, your comment is unpublished.
    Alex T · 3 years ago
    Thanks so much!


    Saved me big time of having to do 800+ of these cells!
  • To post as a guest, your comment is unpublished.
    Nimrod · 4 years ago
    For some reason this doesn't work for me.
    I created the defined function just as you described, but it doesn't do anything :\
    I also want to merge it with the Hyperlink function, like so:
    =HYPERLINK(=getURL(A1), [A1])

    So that the final result will copy A1's URL and display it as A1's text string (i.e. just copy A1 to another cell, including both its text and hyperlink. A simple thing which Excel doesn't seem to be able to do for some reason...).
  • To post as a guest, your comment is unpublished.
    Zach Solomon-Beloin · 4 years ago
    This saved me a ton of time! I extracted 500 profile IDs from 500+ names linked to their profiles. This code worked extremely well and was easy to follow. Thanks so much!
  • To post as a guest, your comment is unpublished.
    AJITA · 4 years ago
    Superb! reduced my work to less than a minute.
  • To post as a guest, your comment is unpublished.
    Tj · 4 years ago
    thanks for saving me 15mins
  • To post as a guest, your comment is unpublished.
    Arun Kumar · 4 years ago
    This is the first ever macro based excel tip that worked for me. Thank you very much for making the lives of excel dummies better.
  • To post as a guest, your comment is unpublished.
    Monica · 4 years ago
    Thank you so much :lol: I used the VBA method and it worked like a charm in Excel 365 on a Windows 8.1 OS
  • To post as a guest, your comment is unpublished.
    chris · 4 years ago
    thanks a ton. like everyone else here. this is very helpful and easy.
  • To post as a guest, your comment is unpublished.
    Eva · 4 years ago
    Super! So easy. Thanks!
  • To post as a guest, your comment is unpublished.
    Tzally · 5 years ago
    Thanks a lot! Very helpful yet simple and clear. Just as Albert meant :roll:
  • To post as a guest, your comment is unpublished.
    JC · 5 years ago
    Thankyou so much. it really helped me
  • To post as a guest, your comment is unpublished.
    Thank You · 5 years ago
    Thanks buddy.It really work in seconds.
  • To post as a guest, your comment is unpublished.
    fab · 5 years ago
    You are the best, so easy to follow!
  • To post as a guest, your comment is unpublished.
    Awesome · 5 years ago
    Thank you so much this saved my ass and make me look good.
    8)
  • To post as a guest, your comment is unpublished.
    Respected · 5 years ago
    Thank You SO SO much!
  • To post as a guest, your comment is unpublished.
    vish · 5 years ago
    thnx u made my work so easy
  • To post as a guest, your comment is unpublished.
    PO · 5 years ago
    This just saved me! Thanks
  • To post as a guest, your comment is unpublished.
    mari · 5 years ago
    thanks so much!!! :D
  • To post as a guest, your comment is unpublished.
    bla bla · 5 years ago
    Thankyou so much. it really helped me