+ Reply to Thread
Results 1 to 9 of 9

Finding and Displaying data results from search criteria

  1. #1
    Registered User
    Join Date
    07-22-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Unhappy Finding and Displaying data results from search criteria

    Hi, I'm new and i am trying to create an easy to use search by macro VBA in excel.

    I have a sheet of information where i need to find the data records from either one of the 2 search criterias: Name and NRIC.

    Once a user enter either of this 2 search criterias, i need a macro to search through the data on Sheet "List" and
    return the results on the Sheet "Search".

    Within the list, a search criteria may appear more than once, the search results should display all of the records row by row on Sheet "Search".

    Would it be better to create a user form?

    Can someone kind please help me out on this?
    Attached Files Attached Files
    Last edited by winlam; 07-22-2012 at 11:20 PM. Reason: Add attachment

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Finding and Displaying data results from search criteria

    Hi

    which columns on the list sheet do your 2 criteria match? There are multiple columns that could match the general headings of NAME and NRIC.

    rylo

  3. #3
    Registered User
    Join Date
    07-22-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Finding and Displaying data results from search criteria

    Hi Rylo,

    Thank you for your response.

    For the criteria "Name":
    it can appear in colum D, F, H, J, L, N

    For the criteria "NRIC",
    it can appear in column E, I, K, M, O

    I would also need the results to show their header, that is for e.g:

    Name criteria = Wee Oon Phing - there are a total of 3 results

    Then the returned data should be
    1) Wee Oon Phing + {header} = Witness + Column A
    2) Wee Oon Phing + {header} = Witness + Column A
    3) Wee Oon Phing + {header} = Witness + Column A

    Thank you.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Finding and Displaying data results from search criteria

    Hi

    Copy the headings from List!A3:O3 and put them in Search!A9:O9.

    Put in your selection (either B4 or B5) then run
    Please Login or Register  to view this content.
    HTH

    rylo

  5. #5
    Registered User
    Join Date
    07-22-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Finding and Displaying data results from search criteria

    this is PERFECT! thank you, Rylo!

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Finding and Displaying data results from search criteria

    @ winlam

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  7. #7
    Registered User
    Join Date
    07-22-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Finding and Displaying data results from search criteria

    Hi Hi,

    i was serching for the SOLVED button the whole of yesterday! Couldn't find it... How do i mark as SOLVE? Please help.

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Finding and Displaying data results from search criteria

    Here you go:

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  9. #9
    Registered User
    Join Date
    07-22-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Finding and Displaying data results from search criteria

    thank you so much!

+ 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