+ Reply to Thread
Results 1 to 4 of 4

Thread: Need help getting a Hyperlink to appear in vlookup

  1. #1
    Registered User
    Join Date
    11-09-2010
    Location
    Baltimore, MD
    MS-Off Ver
    Excel 2007
    Posts
    6

    Need help getting a Hyperlink to appear in vlookup

    Hi, I created a vlookup that pulls data from two tabs within my workbook and the results have hyperlinks that are not appearing in the vlookup. The hyperlinks take you to another sheet in the workbook but only appear as text within the vlookup results. I'm attaching my workbook and would appreciatate any help on this. I tried using the =hyperlink befre vlookup but that made everything that appears in the cell a hyperlink even if it's not. I've also tried =gethyperlink in VBA but it did not work.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-09-2010
    Location
    Baltimore, MD
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Need help getting a Hyperlink to appear in vlookup

    Any suggestions? Or ideas?

    Quote Originally Posted by nutathis View Post
    Hi, I created a vlookup that pulls data from two tabs within my workbook and the results have hyperlinks that are not appearing in the vlookup. The hyperlinks take you to another sheet in the workbook but only appear as text within the vlookup results. I'm attaching my workbook and would appreciatate any help on this. I tried using the =hyperlink befre vlookup but that made everything that appears in the cell a hyperlink even if it's not. I've also tried =gethyperlink in VBA but it did not work.

    Thanks in advance.

  3. #3
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,460

    Re: Need help getting a Hyperlink to appear in vlookup

    Try this,

    Insert this VBA in a module,

    Function HyperLinkText(pRange As Range) As String
    
            Dim ST1 As String
            Dim ST2 As String
    
            If pRange.Hyperlinks.Count = 0 Then
               Exit Function
            End If
    
            ST1 = pRange.Hyperlinks(1).Address
            ST2 = pRange.Hyperlinks(1).SubAddress
    
            If ST2 <> "" Then
               ST1 = "[" & ST1 & "]" & ST2
            End If
    
            HyperLinkText = ST1
    
    End Function
    Then C8, copy to C10,

    =HYPERLINK("#'"&SUBSTITUTE(MID(HyperLinkText(INDEX(Data1!$C$3:$E$9,MATCH(A$1,Data1!A$3:A$9,0),ROWS(C $8:C8))),3,250),"!","'!"),INDEX(Data1!$C$3:$E$9,MATCH(A$1,Data1!A$3:A$9,0),ROWS(C$8:C8)))

    C13 to down.

    =HYPERLINK("#'"&SUBSTITUTE(MID(HyperLinkText(INDEX(Data2!$C$3:$H$9,MATCH(A$1,Data2!A$3:A$9,0),ROWS(C $13:C13))),3,250),"!","'!"),INDEX(Data2!$C$3:$H$9,MATCH(A$1,Data2!A$3:A$9,0),ROWS(C$13:C13)))

    VBA from this site,

    http://www.techonthenet.com/excel/macros/extract_hl.php
    Attached Files Attached Files
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  4. #4
    Registered User
    Join Date
    11-09-2010
    Location
    Baltimore, MD
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Need help getting a Hyperlink to appear in vlookup

    Haseeb, a million thanks to you for helping me with this. I didn't think this was possible. Thanks again!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0