How to extract URLs from hyperlinked text in Microsoft Excel

Spread the love

You can extract URLs from the hyperlinked text in Microsoft Excel with Macros. Here are 2 macros, which can extract URLs from any column or cell.

Sub ExtractHyper()
Dim HP As Hyperlink
For Each HP In ActiveSheet.Hyperlinks
HP.Range.Offset(0, 1).Value = HP.Address
Next
End Sub

Here is another macro that you can try which targets a specified range (as written, cell A1 on downward)…
Sub ExtractHyperlinkAddresses()
Dim Cell As Range
For Each Cell In Range("A1", Cells(Rows.Count, "A").End(xlUp))
Cell.Offset(, 1).Value = Cell.Hyperlinks.Item(1).Address
Next
End Sub

You might also like