Forum Discussion

AR-DA950's avatar
AR-DA950
Copper Contributor
Nov 13, 2022

Extract URL from hyperlink formula

i have an excel file with many URLs linked to a word with the format HYPERLINK(url, [link_label]). I tried running a VBA code to open all the URLs at once but this is not working. Same code works for pure links, so i assumed it was due to the formula. i tried extracting the URL from the formula creating this function (found online): Function URL(Hyperlink As Range)
URL = Hyperlink.Hyperlinks(1).Address
End Function

but i get the error #value

anybody knows what might be the issue here? the URL follows a normal format (https://..)

 

 

1 Reply

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    You should look at the formula itself, it probably takes the URL from one or more adjacent cells. Read those cells to reconstruct the url the HYPERLINK formula uses.

Resources