+ Reply to Thread
Results 1 to 8 of 8

Userform: Change Combobox list based on a second ComboBox selection

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    657

    Userform: Change Combobox list based on a second ComboBox selection

    Hi everyone,

    I have a number of combo boxes on a userform:

    ComboBox1: This has a list of quarters, Q1, Q2, Q3, Q4
    ComboBox50 - ComboBox75: This combo boxes should have a list of dates based on the value selected in ComboBox1

    On my excel worksheet "Criteria" I have defined cell ranges Q1Dates, Q2Dates, Q3Dates, Q4Dates

    What I'm trying to do is:

    1. The user selects a quarter in ComboBox1
    2. Based on the selection in #1, Comboboxes 50 - 75 change to reflect the excel range list I've shown above. For example

    if the user selects Q1 in ComboBox1, then the list in Q1Dates found on the Criteria worksheet will be show up in ComboBoxes 50 - 75.

    Any ideas?

    Thanks!!

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 2016
    Posts
    4,895

    Re: Userform: Change Combobox list based on a second ComboBox selection

    change events on comboboxes tend to be hit and miss, but you could put a mouse_up event on combobox1 that populates comboboxes 50-75?

    Hmm.. listboxes are the ones that cause me headaches... change event ought to be good for a combobox/

    Something like:

    Please Login or Register  to view this content.
    Last edited by Arkadi; 03-11-2016 at 02:09 PM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    657

    Re: Userform: Change Combobox list based on a second ComboBox selection

    Hi Arkadi

    Thanks very much for your reply. I've tried the code you suggested but got the following error:

    438
    Object Doesn't support this property or method

    Private Sub ComboBox1_Change()
    If ComboBox1.Value = "Q1" Then
    ComboBox50.List = Range("Q1Dates").Values 'error is on this line
    End If
    End Sub



    Any ideas?

    Thanks very much for your help.

  4. #4
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    657

    Re: Userform: Change Combobox list based on a second ComboBox selection

    Addendum:

    Oh, I see now what you mean with the mouseup event. I put that in, and I'm no longer getting an error, but the dates are not populating.

    Any thoughts?

    Thanks!

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 2016
    Posts
    4,895

    Re: Userform: Change Combobox list based on a second ComboBox selection

    Can you provide a sample workbook?

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 2016
    Posts
    4,895

    Re: Userform: Change Combobox list based on a second ComboBox selection

    its not ".values" ist just .value
    and for a combobox usually change event is not an issue, it was listboxes that have caused me grief.

  7. #7
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    657

    Re: Userform: Change Combobox list based on a second ComboBox selection

    Haha, you're absolutely right. Thanks very much, Arkadi.

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 2016
    Posts
    4,895

    Re: Userform: Change Combobox list based on a second ComboBox selection

    Happy to help

+ 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. ComboBox values source being changed based on another combobox selection in a UserForm
    By stephenanderson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2016, 11:12 PM
  2. [SOLVED] Change next ComboBox list based on previous ComboBox selection
    By SteveTheFish in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2015, 11:23 PM
  3. Change Userform fields based on combobox selection
    By vikrampnz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2014, 06:57 AM
  4. Userform Combobox to populate based on selection in another combobox
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2014, 03:34 PM
  5. Change Userform Label based on ComboBox Selection
    By rbyrd023 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-02-2014, 09:25 AM
  6. [SOLVED] Make combobox list options dependant on selection in another combobox within a userform
    By Vladimir_Dobvchenko in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 05:30 AM
  7. [SOLVED] Change Labels in Userform based on selection in ComboBox
    By johnw993 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-03-2013, 10:52 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