+ Reply to Thread
Results 1 to 2 of 2

Linking Search Results from an existing search macro

Hybrid View

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    4

    Linking Search Results from an existing search macro

    Hello-

    Utilizing the below code, i am able to search for a key word, and resulting tab names with that keyword are provided in the cell directly to the right. I am looking to manipulate this so I can actually click on the resulting tab name(s), and I will be brought to that specific tab.


    I have attached a picture of the cover page I am using to do this.

    Code for the search function is as follows:

    Sub Search()
    ' MKM '
    Dim data, sh, r_count As Long, fsearch As Range
    
    With Sheets(" Cover Sheet")
        If .Range("B12") = "" Then Exit Sub
        With .Range("B12", .Cells(Rows.Count, "b").End(xlUp).Offset(, 1))
            data = .value
            r_count = UBound(data)
    
            For Each sh In ActiveWorkbook.Sheets
                If sh.Name <> " Cover Sheet" Then
                    For i = 1 To r_count
                        Set fsearch = sh.UsedRange.Find(data(i, 1), , xlValues, xlPart)
                        If Not fsearch Is Nothing Then data(i, 2) = IIf(data(i, 2) = "", sh.Name, data(i, 2) & ", " & sh.Name)
                    Next
                End If
            Next
            .value = data
        End With
    End With
    
    End Sub
    Thank You!
    Attached Images Attached Images

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,693

    Re: Linking Search Results from an existing search macro

    You cannot have multiple hyperlinks in the same cell. The way your list is formatted puts the entire list of results in one cell. Therefore you cannot click on individual names to go to different tabs.

    This can be done if you reformat your form to put one name per cell. Also see my signature regarding advice about screen shots.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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.6.0 RC 1