跳到主要內容

如何在Excel中將URL文本轉換為可單擊的超鏈接?

假設您的工作表中有多個URL,但是它們沒有鏈接,現在您需要將所有未鏈接的URL轉換為可單擊的超鏈接,如下面的屏幕快照所示。 當然,您可以雙擊它們一次以使其可單擊,但是如果有很多URL,這將很耗時。 如何在Excel中自動將多個未鏈接的URL轉換為可單擊的超鏈接?


箭頭藍色右氣泡 使用VBA代碼將URL文本轉換為可點擊的超鏈接

除使用以下VBA代碼外,似乎沒有其他有效的方法可以解決Excel中的此問題。

1。 選擇要轉換為可單擊的超鏈接的URL文本範圍。

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

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代碼對您來說有些困難,在這裡,我可以向您介紹一個多功能工具-Excel的Kutools,其 轉換超鏈接 功能,您可以快速處理以下操作:

  • 從超鏈接中提取實際地址;
  • 將網址文字轉換為可點擊的超鏈接
Excel的Kutools : 帶有300多個便捷的Excel加載項,可以在30天內免費試用

如果你已經安裝 Excel的Kutools,請執行以下操作:

1。 選擇要轉換為可單擊的超鏈接的URL文本範圍。

2。 點擊 庫工具 > Link > 轉換超鏈接,請參見屏幕截圖:

3。 在 轉換超鏈接 對話框中選擇 單元格內容替換超鏈接地址,然後點擊 文檔按鈕1 來自的按鈕 結果範圍 指定要放入結果的單元格。

4。 然後點擊 OK,所有選定的純文本鏈接都已轉換為可單擊的超鏈接。 看截圖:

筆記:

1.如果您想將實際地址設為原始範圍,請檢查 轉換來源範圍.

2.如果超鏈接鏈接到當前文檔,請檢查 超鏈接是本文檔中的一個地方 選項。

點擊 轉換超鏈接 進一步了解此功能。

立即下載和免費試用Excel的Kutools!


箭頭藍色右氣泡   演示:使用Kutools for Excel將url文本轉換為可點擊的超鏈接

Excel的Kutools:具有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選項卡為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