跳到主要内容

如何在Excel中将URL文本转换为可单击的超链接?

假设您的工作表中有多个URL,但是它们没有链接,现在您需要将所有未链接的URL转换为可单击的超链接,如下面的屏幕快照所示。 当然,您可以一次双击它们以使其可单击,但是如果有很多URL,这将很耗时。 如何在Excel中自动将多个未链接的URL转换为可单击的超链接?


箭头蓝色右气泡 使用VBA代码将URL文本转换为可点击的超链接

除使用以下VBA代码外,似乎没有其他有效的方法可以解决Excel中的此问题。

1。 选择要转换为可单击超链接的URL文本范围。

2。 按住 ALT + F11 键打开 Microsoft Visual Basic应用程序 窗口。

3。 点击 插页 > 模块,然后将以下代码粘贴到“模块窗口”中。

Sub ConvertToHyperlinks()
'Updateby Extendoffice
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
    Application.ActiveSheet.Hyperlinks.Add Rng, Rng.Value
Next
End Sub

4。 然后按 F5 键运行代码,弹出对话框供您选择范围,然后单击 OK,并且所选的未链接网址已转换为可点击的超链接。 查看屏幕截图:

2

箭头蓝色右气泡 使用 Kutools for Excel 将 url 文本转换为可点击的超链接

也许VBA代码对您来说有些困难,在这里,我可以向您介绍一个多功能工具-Kutools for Excel,其 转换超链接 功能,您可以快速处理以下操作:

  • 从超链接中提取实际地址;
  • 将网址文字转换为可点击的超链接
Kutools for Excel : 带有300多个便捷的Excel加载项,可以在30天内免费试用

如果你已经安装 Kutools for Excel,请执行以下操作:

1。 选择要转换为可单击超链接的URL文本范围。

2。 点击 库工具 > 链接 > 转换超链接,请参见屏幕截图:

3。 在 转换超链接 对话框中选择 单元格内容替换超链接地址和点击 文档按钮1 来自的按钮 结果范围 指定要放入结果的单元格。

4。 然后点击 OK,所有选定的纯文本链接都已转换为可单击的超链接。 看截图:

笔记:

1.如果您想将实际地址设为原始范围,请检查 转换来源范围.

2.如果超链接链接到当前文档,请检查 超链接是本文档中的一个地方 选项。

点击 转换超链接 进一步了解此功能。

立即下载和免费试用Excel的Kutools!


箭头蓝色右气泡   演示:使用 Kutools for Excel 将 url 文本转换为可点击的超链接

Kutools for Excel:具有300多个方便的Excel加载项,可以在30天内免费试用,没有任何限制。 立即下载并免费试用!

相关文章:

如何从Excel中的超链接中提取实际地址?

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Дай бог здоровья, вам, вашим матерям и детям, первенца в честь автора назову
This comment was minimized by the moderator on the site
Muito bom, só uma dúvida, existe a possibilidade de deixar um intervalo fixo já na macro (sem precisar aparecer aquele pop-up pra selecionar o intervalo), tipo clico pra excutar a macro e ele pega o intervalo que já está configurado na macro e ativa os links, pulando a etapa de ter que clicar em ok e tals. Se puderem me ajudar com esse dúvida serei grato.
This comment was minimized by the moderator on the site
Hello, Tosetti

To solve your problem, please apply the below code: (First, you should select the hyperlink texts)

Sub ConvertToHyperlinks()
'Updateby Extendoffice
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
Set WorkRng = Application.Selection
For Each Rng In WorkRng
    Application.ActiveSheet.Hyperlinks.Add Rng, Rng.Value
Next
End Sub

Please try it, hope it can help you!
This comment was minimized by the moderator on the site
Oh crap.... it broke my Excel. By mistake I selected entire column and it forze for... ages!!
This comment was minimized by the moderator on the site
hi
when i click on the hyperlink .. it wont take to me to email page ( as an Outlook or Gmail) Please support
This comment was minimized by the moderator on the site
Hello, Babu,
May be the below article can help you for solving your problem, please view it:
https://www.extendoffice.com/documents/excel/3304-excel-convert-email-to-hyperlink.html

Hope it can help you!
This comment was minimized by the moderator on the site
I had to switch nearly 55,000 cells from plain text to hyperlinks. This helped me cut the time down from "the rest of my natural life" to five minutes. Thank you!
This comment was minimized by the moderator on the site
This is very helpful...Thanks
This comment was minimized by the moderator on the site
This is Great! Worked like a charm
This comment was minimized by the moderator on the site
Man! This is so awesome, I've spent so long trying to find an easy way and this took seconds! Works great!!!
This comment was minimized by the moderator on the site
Thanks a lot my friend! it worked! :lol:
This comment was minimized by the moderator on the site
The code almost works, but author has left a small copy-paste error. You need to remove "" from the first line, and "" from the last line, and then it will work. Cheers.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations