56 free macros indexedAll toolsHow to runBlogGitHub ↗

How to Extract URLs from Hyperlinks in Excel

How to extract the underlying URL from clickable hyperlinks in Excel: GET_URL trick, custom UDF, and a free macro that converts to plain text in one pass.

2026-04-28

The "I need the URL not the friendly text" problem

You have a column of clickable hyperlinks. Each cell shows friendly text like Click for details or View report. The actual URL lives behind the link. You need the URL as plain text — for an audit, a script, a paste into another system.

Excel has no built-in =URL_FROM_HYPERLINK() function. Here are the workarounds.

TL;DR — Key takeaways

  • Manual right-click > Edit Hyperlink lets you copy the URL one cell at a time.
  • A custom UDF in VBA returns the URL from a hyperlink cell.
  • A free VBA macro extracts URLs from every hyperlink in a selection and replaces the cell content with plain URL text.

Method 1: Manual right-click > Edit Hyperlink

For a single cell:

  1. Right-click the hyperlinked cell.
  2. Click Edit Hyperlink.
  3. The dialog shows the URL in the address field. Copy it.
  4. Click Cancel to close without changing.
  5. Paste the URL where you need it.

The catch: one cell at a time. For 50 hyperlinks, this is a lot of right-clicking.

Method 2: Custom UDF

A small VBA function:

Public Function URL_FROM_HYPERLINK(cell As Range) As String
    If cell.Hyperlinks.Count > 0 Then
        URL_FROM_HYPERLINK = cell.Hyperlinks(1).Address
    Else
        URL_FROM_HYPERLINK = ""
    End If
End Function

Drop in a module. Then =URL_FROM_HYPERLINK(A2) in a helper column returns the URL.

The catch: the result is a formula. Helper column to maintain. Paste-as-values to lock the URLs in place if you need them as static text.

Method 3: The free VBA macro

Download Convert Hyperlinks to Plain Text. Free .xlsm with one macro.

  1. Select the range with hyperlinks.
  2. Alt + F8, pick the macro, click Run.
  3. Macro extracts each cell's URL, removes the hyperlink object, replaces cell content with the URL as plain text.

In place. Plain values. One pass for any number of cells.

A common scenario: link-checker audit

Marketing analyst needs to feed every URL in a campaign report into a link-checker tool. The report has 180 hyperlinks with friendly display text.

  1. Make a copy of the report (so the original stays clickable for the team).
  2. In the copy, select the link column.
  3. Run Convert Hyperlinks to Plain Text.
  4. 180 cells now contain plain URL text.
  5. Copy the column, paste into the link-checker.

Versus right-click-Edit-Hyperlink-Copy: about 30 seconds per cell, or 90 minutes for 180 cells. Macro: 1 second.

Frequently asked questions

What if a cell has multiple hyperlinks?

The macro extracts the first hyperlink's URL. Cells with multiple hyperlinks are rare in normal Excel use because the cell display only shows one. If you have multi-hyperlink data, use the UDF approach to extract by index.

What if I want to keep the friendly text alongside the URL?

Copy the column to an adjacent column first. Run the macro on the copy. Now you have friendly text in the original column and URLs as plain text in the copy.

Will it remove internal-link hyperlinks (like links to another sheet)?

Yes. Internal links have a URL too (the sheet name and cell reference). The macro extracts that. If you want to preserve internal links and only convert external ones, add a check on the URL prefix in the .bas source.

Can I run it on a single cell?

Yes, the macro works on whatever you select, including a single cell.

Can I undo it?

Yes, Ctrl/Cmd + Z right after running.

What to do next

For the reverse direction (text URLs becoming clickable hyperlinks), use Bulk Add Hyperlinks. The two macros pair: link-it-up for distribution, extract-it for audit.