Referring to a hyperlink

A

a7yvm109gf5d1

I have a cell that has a hyperlink added to it via CTRL-K.

Is there a way for the hyperlink function to grab that info? As opposed
to having a path stored in a cell, I have a "friendly name" in there
with ctrl-k'd hyperlinks. I know how to use hyperlink if my target cell
contains a path name in clear text, just not the other way.

Hope I'm clear.
 
G

Guest

Take you hyperlink apart into two parts and then use the hyperlink() function:


First enter this tiny UDF:

Function hyp2(r As Range) As String
hyp2 = r.Hyperlinks(1).Address
End Function

This function will return the URL or target of the hyperlink.



If your hyperlink is in A1 then in B1 put =A1 gets you the friendly name
in C1 put =hyp2(A1) gets you the URL or target
in D1 put =HYPERLINK(C1,B1) this gives you the hyperlink as a function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top