+ Reply to Thread
Results 1 to 10 of 10

Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a userform

  1. #1
    Registered User
    Join Date
    05-21-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    15

    Thumbs up Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a userform

    http://www.excelforum.com/excel-prog...-combobox.html
    Hi All,

    In the attached file,

    Given:
    1) In 'Sheet1" my data are in Column A,B,C,D,E,F&G. On the userform, there are 4 'ComboBoxes' and 1 'ListBox'.

    Required: As Userform activates, I want to
    1) Populate whole data from 'Sheet1' in the 'ListBox1".
    2) Populate 'Column A' data in 'ComobBox1'

    Then,
    3) Based on 'ComboBox1' selection populate matching 'Column B' data in 'ComboBox2".( Also, update 'ListBox1')
    3) Based on 'ComboBox1' and 'ComboBox2' selections populate matching 'Column C' data in 'ComboBox3"".( Also, update 'ListBox1')
    4) And finally based on 'ComboBox 1, 2 & 3", populate 'ComboBox4' from 'Col D' also update 'listbox1'

    I used the code from above link, but unfortunately it did not work.

    Please help me ! I have attached the file.

    Thanks
    p_nayak
    Attached Files Attached Files
    Last edited by p_nayak268; 08-13-2013 at 06:38 AM.

  2. #2
    Registered User
    Join Date
    05-21-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a user

    Hi,
    I noticed that when Col A values are replaces with text, the cascading comboboxes do work (with existing code), but I want COl A should be with numbers only (Years).

    Also, initial question regarding 'ListBox' population as per combobox selection remains unsolved.

    So, can someone help please ?


    Thanks,
    p_nayak

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a user

    Hi p_nayak

    Try the Code in the attached. It appears to work on your sample file...let me know of issues.
    Attached Files Attached Files
    John

    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.

  4. #4
    Registered User
    Join Date
    05-21-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a user

    Hello John,

    When I select one by one item (From CB1 to CB4) it work fine. But, When I go back to select another item in previously selected combobox, I get the error msg.(Run-time eror '1004').

    Except that, your code works, perfectly. The way, I expected. Could you please fix this ?


    Thank you very much.I appreciate your time and effort.

    p_nayak268

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a user

    Hi p_nayak

    Try the Code in the attached...
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-21-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a user

    Hello John,



    Perfect !! Solved.

    Thanks a lot.

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a user

    You're welcome...glad I could help. Thanks for the Rep.

  8. #8
    Registered User
    Join Date
    09-27-2014
    Location
    Raleigh, NC
    MS-Off Ver
    2013
    Posts
    3

    Re: Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a user

    Hello John,

    I used your code in a slightly different way and I was wondering if you could help me make one tweak?

    After I make the first selection on the userform, it filters as I want, however, when I go to the next combobox it gives me all the values in that column. Is there any way to make these unique? For example, in the original document if you pick 2013, then for month Jan shows up multiple times. Any easy way to prevent this and only have it show up once?

    Any help would be greatly appreciated!

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a user

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Filter worksheet data using 4 dependant comboboxes and populate in 'ListBox' on a user

    Hi laurentaylor

    Welcome to the Forum!!!

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ 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. VBA userform listbox populate data entered from comboboxes
    By Hilton1982 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2012, 11:29 PM
  2. Populate text boxes dependant on the display in 2 comboboxes
    By Tony0437 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-07-2012, 10:53 AM
  3. Replies: 4
    Last Post: 11-03-2011, 12:58 AM
  4. How to create a Userform with dependant comboboxes?
    By Danaf in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2008, 06:31 PM
  5. UserForm with Multiple ComboBoxes Populate
    By RobertCo in forum Excel General
    Replies: 2
    Last Post: 12-27-2006, 01:51 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