Convert URL text to clickable hyperlink in Excel

1. Select the range of url text that you want to convert to clickable hyperlinks.

2. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

3. Click Insert > Module, and paste the following code in the Module Window.

1
2
3
4
5
6
7
8
9
10
11
12
Sub ConvertToHyperlinks()
'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
    Application.ActiveSheet.Hyperlinks.Add Rng, Rng.Value
Next
End Sub

4. Then press F5 key to run the code, a pop up dialog for you to select a range, then click OK, and the selected unlinked urls have been converted to the clickable hyperlinks.

This entry was posted in Windows and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *