Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Converting a Range of URLs to Hyperlinks.

Converting a Range of URLs to Hyperlinks

by Allen Wyatt
(last updated October 18, 2016)


John has a workbook that has well over a thousands URLs in it, all in column A. These are not hyperlinks; they are straight text of individual URLs. John wants to convert the URLs to active hyperlinks, but doing the conversion individually is extremely tedious, especially for that many URLs.

As is the case with most tedium in Excel, the solution is to use a macro to do the conversion. To be effective, the macro would need to step through each cell in a selected range and, if the cell is not blank, convert the contents to a hyperlink. The following will do the trick:

Sub URL_List()
    For Each cell In Selection
        If cell.Value <> "" Then
            If Left(cell.Value, 7) = "http://" Then
                URL = cell.Value
                URL = "http://" + cell.Value
            End If
            ActiveSheet.Hyperlinks.Add Anchor:=cell, _
              Address:=URL, TextToDisplay:=cell.Value
        End If
    Next cell
End Sub

The macro is not foolproof; it assumes that if a cell contains anything at all it is a valid URL. What it does is to check the cell contents and, if the contents aren't prefaced by the "http://" text, then it is added. The hyperlink is then created based on the cell contents.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (5825) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Converting a Range of URLs to Hyperlinks.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...


Turning Off Capital Corrections

If you type two capital letters at the beginning of a word, Word assumes that you made a typing error and will attempt to ...

Discover More

Copying a File in VBA

Need to have your macro copy a file from one place to another? It's easy to do using the FileCopy command, described in ...

Discover More

Converting Endnotes to Regular Text

If you have a document with lots of endnotes, you may need them converted to regular text so that they can be used ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Get Rid of Web Stuff

When you copy information from a Web page and paste it into a worksheet, you can end up with more than you bargained for. ...

Discover More

Setting Web Fonts

Is your worksheet information destined for a Web page? Here's how you can specify the fonts that should be used when ...

Discover More

Specifying a Browser in a Hyperlink

Excel allows you to easily add hyperlinks to a worksheet. Click on it, and the target of the link is opened in a browser ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 1 + 5?

2016-11-07 12:04:08


Good morning -

I have a similar problem, but my reference columns contains blanks.. how would i convert that to a hyperlink.

cell text: world/

what i would like the link to look like:

2013-07-22 21:19:36


Thanks for the suggestions, but I think I've discovered a way that appears even easier than that suggested either here or on "getting rid of hyperlinks without a macro" tips.

This assumes that all cells that could contain hyperlinks do so. If some do & some don't, then skip step 1.

1. Highlight the first cell containing a hyperlink, right-click and select "remove hyperlink".
2. Still on a deactivated hyperlink, click on Home tab, double-click on Format painter icon.
3. Select each cell, group of cells, column or row you want to remove hyperlinks from in turn.
4. When you've finished, press escape to end Format painter.

2013-07-22 08:23:51



Using the search box at the upper-right of this page, enter "remove hyperlinks" (without the quote marks) and you'll find several ways to get rid of lots of hyperlinks at once.


2013-07-22 08:00:49


For something this trivial either way, the determining factor should be how often you need to do the action. If you are adding hyperlinks daily, then use the macro (saved to your Personal.xlsb). If you are only doing it once, then use the formula.

When using the formula, if you don't want the extra column, then copy it and select Paste Special -> Values. You can then delete the extra column.

2013-07-22 07:07:18


Mike - you can select a group of cells and right click and then click on Remove Hyperlinks (I've tried this in Excel 2010 and it works).
Colin / Barouh - I suppose sometimes you do not want to create extra columns in your data when a simple function/macro will solve the issue.

2013-07-22 04:36:26


As far as I can see, the same result can be received with pretty simple formula - using HYPERLINK (plus CONCATENATE and SUBSTITUTE if necessary)

2013-07-20 23:55:26


It is not necessary to build a macro to solve this problem. Excel's HYPERLINK function is designed for this very purpose and with the same logic prescribed for the macro can be used in a formula such as the following and copied to each cell in a column adjacent to the text entries:

2013-07-20 07:16:02


I've not had the need for this tip yet, but I have had the need to remove a batch of hyperlinks, particularly for email addresses. I know I can right-click on an individual cell and select "remove hyperlink", but this option is not available if you select a number of cells containing hyperlinks.

Any suggestions?

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.