Excel - List a Hyperlink in a Cell

This is a useful little macro. It could be of use when you have documents hyperlinked in an Excel column and need to copy them elsewhere. Once you have the addresses of the links, you can do so in a batch file.

To get the address of the hyperlinks listed in an Excel column, enter this macro in a VBA module:

Public Function GetURL(c As Range) As String

On Error Resume Next

GetURL = c.Hyperlinks(1).Address

End Function

Then put this formula, =GetURL(A1) in a cell, where the link you need is listed in cell A1.

Special thanks to Ellesa who posted this macro at: