View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Lookup Hyperlink

The first question is easy. If you have a formula like:

=VLOOKUP(A1,G1:H100,2) that returns a "cold" hyperlink, replace it with:
=HYPERLINK(VLOOKUP(A1,G1:H100,2))

The second question involves the use of this UDF:

Public Function hyp(r As Range) As String
hyp = ""
If r.Hyperlinks.Count 0 Then
hyp = r.Hyperlinks(1).Address
Exit Function
End If
If r.HasFormula Then
rf = r.Formula
dq = Chr(34)
If InStr(rf, dq) = 0 Then
Else
hyp = Split(r.Formula, dq)(1)
End If
End If
End Function

So if A1 contains an Inserted hyperlink or a formula like:

=HYPERLINK("http://www.cnn.com","news")

=hyp(A1) will display the URL

http://www.cnn.com
--
Gary''s Student - gsnu200788


"Tommy" wrote:

Q.1) The VLOOKUP only allows copying of lookuped text specified by VLOOKUP
(lookup_value, table_array, col_index_num, range_lookup) which is in text
format ;
however, if we want to get the hyperlink assigned to each of the text, how
do we do that?

Q.2) Apart from doing it manually, how to extract the hyperlink of a column
into a extra column and appears in text format (e.g.
http://www.microsoft.com) ?