How can I extract URL from hyperlinks?

Occasional Visitor

I have a worksheet where one column contains hyperlinks (like created with =HYPERLINK(link;text)). How can I create a formula extracting link urls from those hyperlinks? I've tried dozen of search queries and carefully read everything found, but couldn't find a way.

6 Replies




  1. Right-click a hyperlink.
  2. From the Context menu, choose Edit Hyperlink. Excel displays the Edit Hyperlink dialog box.
  3. Select and copy (Ctrl+C) the entire URL from the Address field of the dialog box.
  4. Press Esc to close the Edit Hyperlink dialog box.
  5. Paste the URL into any cell desired.

@Abiola1 The link you provided no longer seems to work.



Here's another non-scripting method I've used for years.


1. Copy your column containing the links and paste it into a Word document.

2. Save your Word document as "Web Page (*.htm, *.html)".

3. Right-click on the .htm file and open in Notepad (to view the html source code).

4. Find the rows of code that contain your hyperlinks and copy them, then paste into a Word document. 

5. Use find and replace to delete unwanted code until you are left with only the hyperlinks. 

6. Create a new column next to your original column in your spreadsheet and paste them in. 

7. Check the beginning and end to make certain the URLs are pasted back into the corresponding rows.



Extract actual addresses from hyperlinks with VBA code

Press on the heading to get more possibilities and options.


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

  Click Insert> Module and paste the following code into the module window.


Sub Extracthyperlinks ()

'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: =

For Each Rng In WorkRng

     If Rng.Hyperlinks.Count> 0 Then

         Rng.Value = Rng.Hyperlinks.Item (1) .Address

     End If


End Sub


Then press F5 when you press the key to run the code, it will bring up a dialog box for you to choose the hyperlinks that you want to extract the actual addresses from.

Then click OK and the selected cell contents will be converted to the real hyperlink addresses in the original range.