ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Referring to a hyperlink (https://www.excelbanter.com/excel-discussion-misc-queries/74515-referring-hyperlink.html)

[email protected]

Referring to a hyperlink
 
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.


Gary''s Student

Referring to a hyperlink
 
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.
--
Gary's Student


" wrote:

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.



[email protected]

Referring to a hyperlink
 
Thanks. Much to learn I have...



All times are GMT +1. The time now is 10:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com