One of the good things about blogging is I’m always learning new things. When I run into a problem I research ways to solve the problem. Often, if I have an idea of something I’d like to try, I look around and figure out how to do it. Even though my husband is a web guy and probably knows most of the answers, I do not like to bother him. Unfortunately and fortunately, he is busy doing his own work for clients at MBSquared. Today’s problem was figuring out how to change hyperlinks to text showing the URL address in Excel. I wanted to convert a column with hyperlinks to only display the links. I was searching for a way to pull out hyperlinked text from code and have only the URLs displayed. Does that make sense?
How to Change Hyperlinks to Text Showing the URL Address in Excel
Here’s what I was trying to do. I use a site called Board Booster to schedule my pins. I love it, by the way. Anyway, I wanted to pull out the most popular pins and create a spreadsheet with links (URLs displayed) to those pins.
My spreadsheet looked like this, but in order to repin those Pinterest pins in Board Booster, I need the actual URLs. Yes, I could go one-by-one an extract the URL from each hyperlink (right click – edit hyperlink – copy URL), but that would be very time consuming.
Luckily, I found a way to convert my column with hyperlinks to display the links in URL form. Actually, even better, this will extract a URL from a hyperlink and display it in the column beside it. This little macro code will do all of the tedious work for you and convert every single hyperlink to URL text at the same time!
Here is how to Extract a URL from a Hyperlink and Display only the URL Address as Text in Excel
Directions on How to Change Hyperlinks to Text Showing the URL
First, once your column is selected, in your Excel workbook, go to Tools – Macro – Visual Basic Editor.
Next, once you are in the Visual Basic Editor, go to Insert – Module.
Then, copy this text into the editor:
Dim HL As Hyperlink
For Each HL In ActiveSheet.Hyperlinks
HL.Range.Offset(0, 1).Value = HL.Address
Finally, run the program by pressing F5 on your keyboard. Now, you have a separate column that converted your hyperlinks into URL addresses.
Yay! You successfully Changed Hyperlinks to Text Showing the URL Address in Excel!