Hyperlink text

G

Guest

I have a hyperlink, in a cell, say cell A1.

This text, for example it may say 'blah', is then hyperlinked to a webpage,
say www.hyperlink.com.....ie the text is not related to the name of the
hyperlink.

Is there a way i can then get the actual hyperlink, www.hyperlink.com, to
appear in the next column?
 
C

Chip Pearson

If you entered the hyperlink using Insert->Hyperlink rather than
the HYPERLINK function, you can use the following function to get
the address:

Function GetHyperLinkAddress(Rng As Range) As String
GetHyperLinkAddress = Rng.Hyperlinks(1).Address
End Function

You can then call this from a cell with

=GetHyperLinkAddress(A1)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
G

Guest

Yes:

enter this tiny UDF:

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

if A1 has a hyperlink in it then
=hyp2(A1) will display the URL (address part)
 

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