Saturday, August 31, 2013

Get URL from an hyperlink in Excel

VBA code to get the URL address from a link:

'Extract URL from hyperlink
Function HLink(rng As Range) As String
  If rng(1).Hyperlinks.Count Then HLink = rng.Hyperlinks(1).Address
End Function

1 comment:

  1. I never thought its possible to get the URL from a link. I used to do it manually, this code will really help save lot of my time.
    Please add me in the distribution list, I would like to get regular updates. It is really helping me at work.