+ Reply to Thread
Results 1 to 8 of 8

x2 Dependent ComboBoxes with Unique Values

  1. #1
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    x2 Dependent ComboBoxes with Unique Values

    Hi all,

    I've searched all the threads and cant find a solution that works to my problem. I have two Combobox's, the first of which should present a "unique" set of values from sheet1 column A, and the second should present the corresponding unique values from sheet1 column B. I can get the first bit working but can't get the population of the second Combobox (see attached).

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: x2 Dependent ComboBoxes with Unique Values

    Try this:-
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,963

    Re: x2 Dependent ComboBoxes with Unique Values

    You could use ADO

    Please Login or Register  to view this content.
    Then call getdata from the combobox1 change event:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: x2 Dependent ComboBoxes with Unique Values

    How about
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Re: x2 Dependent ComboBoxes with Unique Values

    That's great, works really well.

    Just now trying to integrate this into the other code that writes the data from other comboboxes and textboxes from the same userform to sheet "Data" and im not sure how to get that to work together. Combobox 1&2 above are now called Combobox 4&5. I've added all the code together below so you can see what it is.

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: x2 Dependent ComboBoxes with Unique Values

    These 2 lines
    Please Login or Register  to view this content.
    Need to go at the very top of the module, before any code.
    If you are still having problems, then you will need to supply another workbook with the modified userform & data

  7. #7
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Re: x2 Dependent ComboBoxes with Unique Values

    Got it working, thanks for your help.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: x2 Dependent ComboBoxes with Unique Values

    Glad we could help & thanks for the feedback

+ 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. Replies: 13
    Last Post: 10-20-2019, 05:39 AM
  2. [SOLVED] vba excel - identifying unique values using userform comboboxes
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2017, 09:17 PM
  3. Dependent Comboboxes
    By gandreso in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-27-2016, 10:46 AM
  4. Replies: 3
    Last Post: 02-18-2015, 02:02 PM
  5. [SOLVED] Dependent comboboxes
    By ObiWanBaloney in forum Excel General
    Replies: 6
    Last Post: 06-04-2012, 08:40 PM
  6. [SOLVED] Unique values in dependent drop downs
    By ertweety in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2012, 10:27 AM
  7. dependent comboboxes
    By humboldtguy in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-14-2010, 10:40 PM

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