I have a collection of Hyperlinks from an old Excel sheet. I am trying to extract link texts from each Hyperlink using this function
Function GetURL(rng As Range) As String On Error Resume Next GetURL = rng.Hyperlinks(1).Address End Function
But it doesn't work on the old Hyperlinks ( these links are clickable and they work ) however the function works if new Hyperlinks were inserted using
command+k
The difference that I am seeing between the links created both ways are
The old Hyperlinks shows up in the formula bar as
=HYPERLINK("http://www.genome.jp/kegg-bin/show_pathway?ko00620+C00058","ko00620")
And when I use command+k to insert Hyperlinks the formula bar shows just the link name.
How can I extract link texts from
=HYPERLINK("http://www.genome.jp/kegg-bin/show_pathway?ko00620+C00058","ko00620") using macro, Excel VBA?
I see another question and answer here but I do not know how to implement that function.
HyperLinkText
in the link you have mentioned has to be used in the same way as you are using yourGetURL
function. Can you elaborate how are you using functionGetURL
? – Mrig=HyperLinkText(A1)' in your sheet after adding the module
HyperLinkText` which is in answer in the link you mentioned. – Mrig