excel 获取url图片_从Excel超链接获取URL

本文介绍了如何从Excel超链接中提取URL地址,包括在Excel 2010中快速删除超链接的方法,以及使用VBA编写自定义函数HLink来获取超链接位置的技巧。此外,还提供了更多关于添加和移除超链接的资源。
摘要由CSDN通过智能技术生成

excel 获取url图片

Last week on the Bacon Bits blog, Mike Alexander showed how to send an email with the HYPERLINK function in Excel, complete with subject line and message. Mike's article showed how versatile the HYPERLINK function can be, and you also learned about Mike's unique talent for poetry. Here's how to get the URL from an Excel Hyperlink.

上周,在培根比特斯(Bacon Bits)博客上,迈克·亚历山大(Mike Alexander)演示了如何在Excel中使用HYPERLINK功能发送电子邮件 ,并附带主题行和消息。 Mike的文章展示了HYPERLINK功能的通用性,并且您还了解了Mike独特的诗歌才能。 这是从Excel超链接获取URL的方法。

删除超链接 (Remove Hyperlinks)

If you inherit a workbook full of hyperlinks, and you want to change those, so they just contain text, you can copy the cells, and paste them as values, in another location. If you're using Excel 2010, you can quickly remove hyperlinks from selected cells. (Thanks to Sam for this tip.)

如果您继承了一个充满超链接的工作簿,并且想要更改它们,以便它们仅包含文本,则可以复制单元格并将它们作为值粘贴到另一个位置。 如果您使用的是Excel 2010,则可以快速从选定的单元格中删除超链接。 (感谢Sam提供的提示。)

  1. In Excel 2010, select cell(s) that contain hyperlinks

    在Excel 2010中,选择包含超链接的单元格
  2. Right click on any selected cell

    右键单击任何选定的单元格
  3. Click Remove hyperlinks

    单击删除超链接

In any version, to remove hyperlinks in a group of selected cells, you can run a macro, like the one below. Copy this code into a regular module in your workbook, then select the cells, and run the delHyperlinks macro.

在任何版本中,要删除一组选定单元格中的超链接,您都可以运行一个宏,如下所示。 将此代码复制到工作簿中的常规模块中,然后选择单元格并运行delHyperlinks宏。

Sub delHyperlinks()
  Selection.Hyperlinks.Delete
End Sub

You can also clear all the hyperlinks on the active worksheet (thanks Eric and Rick).

您还可以清除活动工作表上的所有超链接(感谢Eric和Rick)。

Sub RemoveHyperlinksOnActiveSheet()
'posted by Rick Rothstein
  Cells.Hyperlinks.Delete
End Sub

从超链接中提取地址 (Extract Address from Hyperlink)

If you paste hyperlinks as values, what you're left with is the "Friendly Name." That's the text you can see in the cell with the hyperlink, like "Sales Report" in the screen shot below.

如果将超链接粘贴为值,则剩下的就是“友好名称”。 这是您在带有超链接的单元格中看到的文本,例如以下屏幕截图中的“销售报告”。

HyperlinkDrag04

Instead of the Friendly Name, you might want to extract the hyperlink's location. There's no built-in function for that in Excel, but you can create your own, with a bit of VBA.

您可能要提取超链接的位置,而不是友好名称。 Excel中没有用于该功能的内置函数,但是您可以使用一些VBA创建自己的函数。

Copy the HLink code, shown below, into a regular module in your workbook.

将如下所示的HLink代码复制到工作簿的常规模块中。

Function HLink(rng As Range) As String
'extract URL from hyperlink
'posted by Rick Rothstein
  If rng(1).Hyperlinks.Count Then HLink = rng.Hyperlinks(1).Address
End Function

Then, you can use the HLink function in that workbook, just like any other Excel function. For example, to find the address for a hyperlink in cell B3, use this formula: =HLink(B3)

然后,您可以在该工作簿中使用HLink函数,就像其他任何Excel函数一样。 例如,要在单元格B3中查找超链接的地址,请使用以下公式: = HLink(B3)

To extract the Friendly Name, use a simple link to the cell: =B3

要提取友好名称,请使用指向该单元格的简单链接: = B3

hyperlinkextract01

了解有关超链接的更多信息 (Learn More About Hyperlinks)

To learn more about adding and removing Hyperlinks, visit the Excel Hyperlinks and Hyperlink Function page on the Contextures website.

若要了解有关添加和删除超链接的更多信息,请访问Contextures网站上的“ Excel超链接和超链接功能”页。

There are written instructions, and videos, like this one.

这里有书面说明和视频。

演示地址

翻译自: https://contexturesblog.com/archives/2010/12/13/get-the-url-from-an-excel-hyperlink/

excel 获取url图片

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值