提示:其它语言是由 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。 支持所有语言。 在您的企业或组织中轻松部署。 全功能60天免费试用。
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 · 3 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 · 4 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