+ Reply to Thread
Results 1 to 10 of 10

ListBox to populate UserForm trouble with same search criteria

  1. #1
    Registered User
    Join Date
    05-25-2013
    Location
    Yonkers NY
    MS-Off Ver
    Excel 2010
    Posts
    28

    ListBox to populate UserForm trouble with same search criteria

    This is part of a much larger program. When you click on the Listbox (workbook attached)- the userform populates. My problem is when I have more than one customer with the same last name - this workbook has 2 customers with the last name "Williams" and will only populate the first one. Is there a way to add another criteria such The "Last Name" and "Phone Number"?




    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: ListBox to populate UserForm trouble with same search criteria

    Hi,
    I use it in one of my files, see if it helps you
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by john55; 03-08-2014 at 02:08 AM.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Registered User
    Join Date
    05-25-2013
    Location
    Yonkers NY
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: ListBox to populate UserForm trouble with same search criteria

    Thanks for your help John. I can't get that code to work on my program. My worksheet has more than 20 columns, the data base could have close to 1000 customers with many customers having the same last name such as, Jones, Smith, or Johnson. So once I enter a customer's name in the texbox and click search, the listbox populates with all the customers with the last name, "Williams." I need to be able to be able to select one "Williams" from another "Williams." I think if once the listbox is populated, if it is possible to make a selection based on "Last Name" and one other criteria, such as a "Phone Number" or "Address. I just don't know if what I am looking for is possible.

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: ListBox to populate UserForm trouble with same search criteria

    I tried it with Brady
    see attach
    Attached Images Attached Images

  5. #5
    Registered User
    Join Date
    05-25-2013
    Location
    Yonkers NY
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: ListBox to populate UserForm trouble with same search criteria

    I can't open the program. It looks like a Jpeg. I cut and pasted the code in my sample program and it is not working. Thanks for your help.

  6. #6
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: ListBox to populate UserForm trouble with same search criteria

    hi,
    it's a jpeg!
    see if the test file attached helps you.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-25-2013
    Location
    Yonkers NY
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: ListBox to populate UserForm trouble with same search criteria

    Thank you so much. The code works perfect!

  8. #8
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: ListBox to populate UserForm trouble with same search criteria

    You're welcome! Thank you for the rep.

  9. #9
    Registered User
    Join Date
    06-06-2014
    Posts
    5

    Re: ListBox to populate UserForm trouble with same search criteria

    Dear john55,

    You have a masterpieces that i been looking for a very long time. I would love to have the exactly function you did for chriswhite1982.
    Only different is the pop out, because on my data here i got no First name or Last name...etc.
    I really appreciate that if you can spend sometimes to create the same function as what you did for chrishite1982.
    I attach here the workbook just a sample. I have create a button at the place i wish. I will input more data from row 13 onwords. I have about 800 row and its growing. So the search function have to be able to gathering data over 2000 row at least.

    Please john55, i seriously need your masterpieces apply on my data.

    Awaits your reply.

    Thank you.

    Warmest Regards,
    Ray
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: ListBox to populate UserForm trouble with same search criteria

    'morning Ray,

    I think you need to open your own thread and ask there according to the forum rules!
    ...but for a start, if you like the above solution just replace "a2" with "e5" and the sheet name also. I assumed that you wanna search for the names in column "e".

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Item in ListBox (search) to populate UserForm with values
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-12-2013, 04:47 AM
  2. [SOLVED] Populate a Listbox in a UserForm based on a Search Result
    By clapforthewolfman in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 07-17-2013, 07:53 PM
  3. Populate a Userform from a selection on a popup search listbox
    By ahmadassaad in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-16-2012, 09:00 AM
  4. Userform populate listbox with search from multiple textboxes
    By chendysworld in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-12-2012, 11:12 AM
  5. Use criteria to populate a userform listbox
    By Magnet in forum Excel General
    Replies: 0
    Last Post: 07-19-2012, 03:25 AM

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