+ Reply to Thread
Results 1 to 4 of 4

How to populate multiple column listbox with unique combinations only

  1. #1
    Registered User
    Join Date
    11-11-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    How to populate multiple column listbox with unique combinations only

    Hello

    I am a VB noob and i am trying to help my non-tech savvy colleagues in a rural non-profit to maintain better data.

    I am sure there are better ways of data maintenance, but they are used to one way of working over the years and I need to align the excel to match their way of doing things.

    They maintain user data with static details (like name, village, occupation, etc.) and dynamic details (service taken, etc.) in the same sheet. Problem is, due to manual entry, the static fields become erroneous.

    So what I want to achieve in the userform is:
    1. If he is new user, he signs up separately.
    2. If old user, he chooses his name in a dropdown list.
    3. User details (static ones) are shown in a listbox. Since there are multiple people with exactly the same name, he chooses which details match him.
    4. These details are passed on to the form and he adds the dynamic details.

    I have done everything, the only two areas where I am blocked are:
    1. How to lookup the values in the excel and display in a multi-column textbox ONLY with the unique combinations. Presently, i am populating a list, but its showing all values and also, i cannot use that for point 2 below. I need a better way.
    2. How to carryover the values to the other userform from the list box (I think I will be able to figure this point out myself if the first problem is resolved)

    I am attaching the sheet with some dummy values for your reference.

    Would it be possible to help? Let me know if I have not been able to convey the issue clearly.

    Copy of Data tool.zipCopy of Data tool.zip

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: How to populate multiple column listbox with unique combinations only

    hi shuvajit, welcome to Excelforum, re 1 problem area:
    1. How to lookup ...
    Check attachment.
    I have made some changes to Initializing code as well.
    Attached Files Attached Files

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: How to populate multiple column listbox with unique combinations only

    Hello shuvajit,

    Welcome to the Forum!

    This should get you started. Now when you select a user's name from the CombBox, a unique list of names is produced in the ListBox. Here is the UserForm code. The attached workbook has all the changes.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    11-11-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: How to populate multiple column listbox with unique combinations only

    Hello

    Thanks for the help... The files work just as i want them to ...

    I am going by Leith's file, because it seems, having the values as separate columns will allow me to carry over the values to the next sheet easily.

    Thanks a lot again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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