How to Convert Text URLs to Clickable Links in Excel


This post will guide you how to convert plain URLs to clickable links in Excel. How do I convert text URLs to clickable links with VBA Macro in Excel. How to convert a list of text links into hyperlinks in Excel.

1. Convert Text URLs to Clickable Links using VBA

Assuming that you have a list of data in range B1:B4, which contain text links, and you want to change those text link as clickable links or hyperlinks in your worksheet, how to achieve it. You can write an Excel VBA Macro to convert plain URLs as clickable links quickly. Just do the following steps:

 #1 select cells that contain Text URLs

convert text urls to hyperlink1-1

#2 open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.

Get the position of the nth using excel vba1

#3 then the “Visual Basic Editor” window will appear.

#4 click “Insert” ->”Module” to create a new module.

convert column number to letter3

#5 paste the below VBA code into the code window. Then clicking “Save” button.

convert text urls to hyperlink1
Sub ConvertTextURLsToHyperlinks()
    Dim Cell As Range
    For Each Cell In Intersect(Selection, ActiveSheet.UsedRange)
        If Cell <> "" Then
            ActiveSheet.Hyperlinks.Add Cell, Cell.Value
        End If
End Sub

#6 back to the current worksheet, then run the above excel macro. Click Run button.

convert text urls to hyperlink2

#7 Let’s see the result:

convert text urls to hyperlink3

You will see that the selected text URLs have been converted to the clickable hyperlinks in your worksheet.

2. Video: Convert Text URLs to Clickable Links

This Excel video tutorial will show you how to convert plain URLs to clickable links using VBA Macro in Excel.

Leave a Reply