- Open up a new workbook.
- Get into VBA (Press Alt+F11)
- Insert a new module (Insert > Module)
- Copy and Paste the Excel user defined function below
Function GetURL(rng As Range) As String
On Error Resume Next
GetURL = rng.Hyperlinks(1).Address
End Function
- Get out of VBA (Press Alt+Q)
So now; you can place below formluae anywhere you want.
for example, the URL from a hyperlink in A1 to be listed in cell A2, then in cell A2 you would enter the following formula:
=GetURL(A1)
Bingo you get the URL!
0 Comments