+ Reply to Thread
Results 1 to 4 of 4

Searching a list and finding the exact match from a sublist

  1. #1
    Registered User
    Join Date
    05-03-2012
    Location
    Italy
    MS-Off Ver
    Excel 2003
    Posts
    3

    Searching a list and finding the exact match from a sublist

    Hello everyone, my first post and I'm not very good at VBA... (hopefully will improve thanks to this wonderful site)

    I have a long list of clients (say in Range ("B1:B500")) and I want the user of this file to be able to find the exact client he is looking for from this list inserting a name (say John) in an inputbox.
    This is the solution I have in my mind:

    1) I should write a routine that searches the full list of clients and exctracts all the matching names (say all names including the "John" in their name) and place them in a specific range
    2) I will then have an ActiveX control (list) that will show the user a smaller set of clients from which to chose from

    Problem is: I'm not able to write point 1. Can anybody help even with general instructions please?
    Thanks a lot in advance.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Searching a list and finding the exact match from a sublist

    Hi and welcome to the forum.

    An easy way to find the row of the name that you are looking for, is using MATCH functions.

    Something Like this, with your name in E1 and list in B1:B500

    =MATCH(E1;B1:B500)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    05-03-2012
    Location
    Italy
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Searching a list and finding the exact match from a sublist

    Thanks a lot Fotis, but I need to find ALL the names that include the word John (I may have about 10 clients named John "Something").
    Then, I would like to place these names in a different range (of which I do not know the size. In this case it will be 10 rows, but it could be anything from 0 to 500)...

  4. #4
    Registered User
    Join Date
    05-03-2012
    Location
    Italy
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Searching a list and finding the exact match from a sublist

    Hi guys, this is the code I've written so far.

    It kind of works, except that it writes the first name found in the list both at the top and at the bottom.
    In addition, do you have more efficient ways to do this?

    Thanks again, ciao
    s

    HTML Code: 
    Attached Files Attached Files

+ 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