3 Best Ways to Extract a URL From Hyperlinks in Microsoft Excel

The data entry and analysis features of Microsoft Excel are well known to its users. Users can create forms and charts and break down large data sets using the functions and formulas within an Excel spreadsheet. However, an often overlooked capability of Excel is its data extraction feature. For example, using the Power Query function in Excel, users can extract data from various online or offline sources.

N_Ways_to_Extract_a_URL_From_Hyperlinks_in_Microsoft_Excel

Additionally, if you are working with a large data set of hyperlinks, there are various ways to extract the URLs, too. We’ve explained three popular methods below, so let’s take a look.

The context menu, also known as the right-click menu in Microsoft Office programs, has a series of shortcuts for performing actions. To extract a URL from a hyperlink in Microsoft Excel, right-click on the hyperlink and choose “Edit Hyperlink” from the context menu. This will open a dialog box where you can see and edit the hyperlink’s URL. Here’s how:

Step 1: From your PC’s Start menu or Taskbar, click the Microsoft Excel app or workbook with the hyperlinks to open it.

Step 2: Click on the Sheet tab with the hyperlinks and select the cell with the hyperlinks.

best ways to extract a URL from hyperlinks in Microsoft Excel 1

Step 3: Right-click the cell with the hyperlink to launch the context menu.

Step 4: Select Edit Hyperlink to launch the Edit Hyperlink dialog box.

best ways to extract a URL from hyperlinks in Microsoft Excel 2

Step 5: Place your mouse cursor in the Address field of the Edit Hyperlink dialog box to highlight the URL.

best ways to extract a URL from hyperlinks in Microsoft Excel 3

Step 6: Right-click the highlighted URL and select Copy. Alternatively, you can use the shortcut Ctrl + C to copy the URL.

best ways to extract a URL from hyperlinks in Microsoft Excel 4

Step 7: Click OK or Cancel to close the Edit Hyperlink dialog box.

best ways to extract a URL from hyperlinks in Microsoft Excel 5

Step 8: Right-click the Excel document or the document where you would like to place the extracted links and select Paste. Alternatively, paste the URL by using the Ctrl + V shortcut.

best ways to extract a URL from hyperlinks in Microsoft Excel 6

And just like that, you will be able to extract URLs from a hyperlink. Note that using the context menu to edit and extract hyperlinks in Microsoft Excel is only advisable when dealing with a small data set.

You can use Word and an HTML reader like Notepad if you need to extract hyperlinks from a moderately sized data set. Copy the hyperlinks from your Excel to a Word document, then save the Word document as HTML. Here’s how you can then extract the URLs from the HTML file.

Step 1: From the Start menu or Taskbar of your PC, click the Microsoft Excel app or workbook with the hyperlinks to open it.

Step 2: Click on the Sheet tab with the hyperlinks and copy all cells with the hyperlinks.

best ways to extract a URL from hyperlinks in Microsoft Excel 7

Step 3: Open a new Word document and paste the copied hyperlinks into the document.

best ways to extract a URL from hyperlinks in Microsoft Excel 8

Step 4: Click the Ctrl + S keys to launch the Save window in Microsoft Word. Alternatively, click the File tab on the Ribbon and select Save As to launch the Save As window.

best ways to extract a URL from hyperlinks in Microsoft Excel 9

Step 5: Enter a name for your file in the File name field.

best ways to extract a URL from hyperlinks in Microsoft Excel 11

Step 6: Click the Save as type drop-down and select .html.

best ways to extract a URL from hyperlinks in Microsoft Excel 10

Step 7: Click Save to create the .html file.

Step 8: Open your Windows File Library and navigate to the location with your saved .html file.

Step 9: Right-click on the file and click Open with Notepad.

best ways to extract a URL from hyperlinks in Microsoft Excel 12

Step 10: Copy the content of the HTML file and paste it into a Word document.

best ways to extract a URL from hyperlinks in Microsoft Excel 13

Step 11: Click the Ctrl + H keys on your keyboard to launch the Find and Replace dialog box. Alternatively, click the Replace button on the Home tab.

best ways to extract a URL from hyperlinks in Microsoft Excel 15

Step 12: In the Find what field, enter the unwanted code surrounding the hyperlink.

best ways to extract a URL from hyperlinks in Microsoft Excel 16

Step 13: In the Replace with field, leave a blank space and click Replace All. This ensures all unwanted code are replaced with a blank space.

best ways to extract a URL from hyperlinks in Microsoft Excel 17

Step 14: Repeat steps 12 and 13 to remove all unwanted code until only the hyperlinks are left.

Step 15: Copy the hyperlinks and transfer them to a blank column in Excel.

best ways to extract a URL from hyperlinks in Microsoft Excel 20

This method is only advisable when dealing with a moderate data set. Additionally, you should only use this method when you’re not pressed for time to extract the hyperlinks.

With VBA, you can create a code to help you extract the hyperlinks within a short amount of time. This is particularly useful when working with a large data set. Here’s how to do so:

Step 1: From your PC’s Start menu or Taskbar, click the Excel workbook with the hyperlinks to open it.

Step 2: Click the Alt + F11 keys on your keyboard to open the VBA window.

Step 3: On the VBA window, click the Insert tab.

best ways to extract a URL from hyperlinks in Microsoft Excel 22

Step 4: Select Module from the options to launch the Module window.

best ways to extract a URL from hyperlinks in Microsoft Excel 23

Step 5: Copy and paste the following code into the Module window.

Sub ExtractHL()
Dim HL As Hyperlink
For Each HL In ActiveSheet.Hyperlinks
HL.Range.Offset(0, 1).Value = HL.Address
Next
End Sub
best ways to extract a URL from hyperlinks in Microsoft Excel 24

Step 6: Click the Run tab and select Run Sub/UserForm.

best ways to extract a URL from hyperlinks in Microsoft Excel 25

Step 7: Close the VBA window by clicking the Alt + Q keys. Your extracted hyperlinks should show up in a new column.

best ways to extract a URL from hyperlinks in Microsoft Excel 26

Hyperlinks in Excel are an easy way to refer to relevant information in a worksheet or move from one worksheet to another. Hyperlinking not only saves time but also helps in organizing data efficiently. If the hyperlinks in your Excel workbook do not work, try checking the link path, repairing the workbook, or running the Office repair tool to fix it.

Was this helpful?

Thanks for your feedback!

Last updated on 11 March, 2024

The article above may contain affiliate links which help support Guiding Tech. The content remains unbiased and authentic and will never affect our editorial integrity.