+ Reply to Thread
Results 1 to 3 of 3

Search for a name into Multiple Tabs

Hybrid View

  1. #1
    Registered User
    Join Date
    04-05-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003/2007
    Posts
    45

    Search for a name into Multiple Tabs

    Hi. I would like to accomplish a task. I know how to use a simple MATCH/INDEX function. But now I come across with multiple tabs. Example:

    I would like to find all info regarding John Doe. But John Doe is sitting on one of those tabs (INFO1-INFO7). How do I search for him using MATCH/INDEX or perhaps by using other functions.

    Notes:
    - I would like to avoid highlighting the tabs and CRTL+F to find what I'm looking for.
    - This worksheet has no duplicate name.

    Please see clean attached file. Thank you very much in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Search for a name into Multiple Tabs

    try it
    Sub ertert()
    Dim x, y(), i&, k&, s$, wsh As Worksheet
    x = Range("A2:B" & Cells(Rows.Count, 1).End(xlUp).Row).Value
    ReDim y(1 To UBound(x), 1 To 3)
    
    With CreateObject("Scripting.Dictionary")
        .CompareMode = 1
        For i = 1 To UBound(x)
            s = x(i, 1) & "|" & x(i, 2): .Item(s) = i
        Next i
        For Each wsh In ThisWorkbook.Worksheets
            If Not wsh Is ActiveSheet Then
                x = wsh.Range("A1").CurrentRegion.Value
                For i = 1 To UBound(x)
                    s = x(i, 1) & "|" & x(i, 2)
                    If .Exists(s) Then
                        k = .Item(s)
                        y(k, 1) = x(i, 3)
                        y(k, 2) = x(i, 4)
                        y(k, 3) = x(i, 5)
                    End If
                Next i
            End If
        Next wsh
    End With
    
    Range("C2:E2").Resize(UBound(y)).Value = y()
    End Sub
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-05-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003/2007
    Posts
    45

    Re: Search for a name into Multiple Tabs

    Hi nilem. Thank you very much for your work and time. I really appreciated it. It worked but not the way I would like to accomplish. I just used John Doe and Jane Doe as an example. I would like to have a formula on column C, D, and E starting at Row 2 so when I fill up Column A and Column B with names, their corresponding info should appear beside them ( column C, D, and E). Please help. Thank you.

+ 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