+ Reply to Thread
Results 1 to 6 of 6

Excel search - Display a third column in the results

Hybrid View

johnrrinc Excel search - Display a... 12-05-2012, 01:07 PM
martindwilson Re: Excel search - Display a... 12-05-2012, 01:42 PM
johnrrinc Re: Excel search - Display a... 12-05-2012, 01:56 PM
johnrrinc Re: Excel search - Display a... 12-05-2012, 02:44 PM
martindwilson Re: Excel search - Display a... 12-05-2012, 03:06 PM
johnrrinc Re: Excel search - Display a... 12-06-2012, 11:57 AM
  1. #1
    Registered User
    Join Date
    12-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    4

    Excel search - Display a third column in the results

    Can anyone help me modify this file so that when searching for a zip against all the worksheets it also displays in the results the data from Column 'C' in the worksheets.

    In other words, under the search worksheet I should see the results as 'School', 'Campus' & 'Notes'

    I can't seem to figure out how to include that additional column. Any help with this is highly appreciated.

    rr_zip_search.xlsm


    Thank you

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Excel search - Display a third column in the results

    change this bit
    Do Until FoundCell Is Nothing
                        With Worksheets(shSearch).Cells(Rows.Count, "f").End(xlUp)
                            .Offset(1) = ws.Name
                            .Offset(1, 1) = FoundCell.Offset(0, -1)
                            .Offset(1, 2) = FoundCell.Offset(0, 1)
                            .Offset(1, 3) = FoundCell.Row
                            
                        End With
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    12-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel search - Display a third column in the results

    Works like a charm! Thank you sir.

  4. #4
    Registered User
    Join Date
    12-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel search - Display a third column in the results

    oh just one more thing I noticed...After making this modification the results display just as expected. I'm able to search a zip code however if I try to run a new search it does not clear the previous results. why is that?

    rr_zip_search.xlsm

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Excel search - Display a third column in the results

    id just change this bit



     With Worksheets(shSearch)
            .Range("f2:i2000").ClearContents
            SearchTerm = .Range("b3")
            
        End With

  6. #6
    Registered User
    Join Date
    12-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel search - Display a third column in the results

    Yep. that worked. 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