Apps & Software

3 Easy Ways to Pull URLs from Hyperlinks in Microsoft Excel

Learn three practical ways to extract the actual URL from a hyperlink in Microsoft Excel, including formula-based methods and a simple VBA option for older workbooks.

Kevin Martin
Kevin Martin
Tech Contributor  •  Sep 21, 2026  •  5 min read

Excel hyperlinks are useful for making spreadsheets easier to navigate, but sometimes you need the underlying web address instead of the clickable text. That can happen when you are auditing links, cleaning imported data, or building a list of destinations from a worksheet full of hyperlinks.

There are a few good ways to extract a URL from a hyperlink in Microsoft Excel. The best method depends on whether the link was created with a formula, inserted manually, or comes from a worksheet you need to process in bulk.

3 Easy Ways to Pull URLs from Hyperlinks in Microsoft Excel

Method 1: Use a Formula for Hyperlinks Created with HYPERLINK()

If the hyperlink was created with Excel’s HYPERLINK function, the destination can usually be recovered from the formula itself. This is the cleanest method because the URL is already part of the formula rather than stored separately in the cell format.

  1. Click the cell that contains the hyperlink.
  2. Look at the formula bar to see whether the cell uses the HYPERLINK function.
  3. If it does, copy the link target from the formula, which is the first argument inside HYPERLINK().
  4. For example, in =HYPERLINK("https://example.com","Visit site"), the URL is https://example.com.
Note This method works only when the hyperlink was created with a formula. It will not help if someone inserted a link manually through the Insert Link dialog.
Why It Matters When a hyperlink is formula-based, the URL is part of the cell formula, so Excel can display or reuse it more easily than a manually inserted link.

Method 2: Use a VBA Function to Extract the Address from a Hyperlink Cell

For manually inserted hyperlinks, Excel does not provide a built-in worksheet formula that directly returns the link address. A small VBA user-defined function can read the hyperlink address from the cell and return it to the sheet.

  1. Press Alt + F11 to open the Visual Basic Editor.
  2. In the menu, choose Insert > Module.
  3. Paste the following code into the module: Function GetURL(cell As Range) As String If cell.Hyperlinks.Count > 0 Then GetURL = cell.Hyperlinks(1).Address Else GetURL = "" End If End Function
  4. Close the Visual Basic Editor and return to the worksheet.
  5. In a blank cell, enter =GetURL(A1), replacing A1 with the cell that contains the hyperlink.

If the hyperlink points to a web page, the function returns the URL. If the cell has no hyperlink, the result is blank.

Warning Macros must be enabled for VBA code to work. Only use code from sources you trust, and save a backup copy of your workbook before adding VBA.
Quick Tip If the hyperlink includes a location within a file, the Hyperlinks(1).SubAddress property may also contain useful information.

Method 3: Extract URLs in Bulk with a Helper Column or Macro

If your workbook contains many hyperlinks, extracting them one at a time is slow. In that case, a helper solution is better. You can fill a formula down a column or use a macro to process every linked cell in a range.

Best For Large worksheets, link audits, and cleanup tasks where you need dozens or hundreds of URLs at once.
  1. Use the VBA function from Method 2 in a helper column if you want a simple formula-based approach.
  2. Enter the function next to the first hyperlink cell.
  3. Copy the formula down alongside the rest of the link cells.
  4. If needed, copy the extracted results and paste them as values to keep only the URLs.

If you prefer automation, a short macro can loop through a selected range and write each hyperlink address into an adjacent column. That is especially helpful when the worksheet contains links in a single consistent column.

Key Fact Manually inserted hyperlinks are stored as hyperlink objects, while formula-created hyperlinks are part of the cell formula. That is why the extraction method depends on how the link was added.

Which Method Should You Use?

If you are unsure how the link was created, click the cell and check the formula bar first. If you see HYPERLINK(), you can read the URL directly from the formula. If not, VBA is usually the most reliable option.

Note The exact behavior can vary slightly between Excel desktop versions and Microsoft 365, but the overall approach is the same.

Common Limitations to Keep in Mind

If your goal is data cleanup, it is worth checking whether you need the full destination exactly as stored or just the readable domain. In many cases, extracting the full URL first makes it easier to standardize the data afterward.

A Simple Workflow for Most Users

  1. Check whether the hyperlink was created with HYPERLINK().
  2. If it was, copy the URL from the formula.
  3. If it was inserted manually, use a VBA function to return the address.
  4. For many cells, fill the extraction formula or macro output down the column.
  5. Paste the results as values if you want a permanent URL list.

That approach covers most Excel hyperlink extraction tasks without unnecessary complexity. Once you know whether the link is formula-based or manually inserted, choosing the right method becomes straightforward.

Topics

More from Apps & Software

View all →
Virtual Machine Showdown: Performance, Features, and the Best Uses for Each
Apps & Software

Virtual Machine Showdown: Performance, Features, and the Best Uses for Each

5 Ways to Fix HP Support Assistant When It Won’t Install
Apps & Software

5 Ways to Fix HP Support Assistant When It Won’t Install

Fixing Format Painter in Microsoft Office When It Stops Working
Apps & Software

Fixing Format Painter in Microsoft Office When It Stops Working

Why the Microsoft Teams Banner Sparked So Much Backlash
Apps & Software

Why the Microsoft Teams Banner Sparked So Much Backlash

How to Fix a Google Chrome Download Stuck at 100%
Apps & Software

How to Fix a Google Chrome Download Stuck at 100%

Microsoft Teams Error Code 42b: What It Means and How to Fix It
Apps & Software

Microsoft Teams Error Code 42b: What It Means and How to Fix It