+ Reply to Thread
Results 1 to 5 of 5

Cascading/dependent combo boxes

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    334

    Cascading/dependent combo boxes

    I have a set of data, in the dynamic range A1:AE and whatever the last row is. Row 1 contains headings.
    I have 2 comboxes; (the yellow highlighted columns)
    1. cbo_DL (Column AF) (Columns AC and AD joined)
    2. cbo_DLS (Column AG) (Columns AC, AD and AE joined)

    I select a value from either combobox and the related values are displayed in a listbox.

    Basically what I would like to do is have 3 comboboxes
    1. cbo_DC (Col AC) (column coloured red)
    2. cbo_LP (Col AD) (column coloured orange)
    3. cbo_Ses (Col AE) (column coloured green) (will always be a value of in the range 1 to 10)

    I select a value in the first combobox (cbo_DC) which then limits my choices for the 2nd comboxbox (cbo_LP) which then limits my choices for the 3rd combobox (cbo_Ses). Like filtering the data first on Column AC, then Column AD, then Column AE.
    I have searched for a solution but I have only found references to dependent comboboxes/cascading comboxes that are not based on a data set.

    Columns AK, AL, AM contain the unique values for each of Columns AC, AD and AE.
    These unique values will NOT always be the same except for column AM, which will always be a number from 1 to 10.
    I believe I need to fill the first combo box, then use 'change event' to fill the other 2 combo boxes to accomplish what I need.


    I have attached a sample workbook.
    Any assistance would be appreciated.
    Attached Files Attached Files
    Last edited by anrichards22; 02-25-2015 at 08:48 AM.

  2. #2
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    334

    Re: Cascading/dependent combo boxes

    I have managed to find some info on how to create the dependent lists, however, it does not appear to be working as required.
    As per the OP, I am looking to create the dependents lists with only the relevant values.
    I have attached a sample workbook.
    ComboBox TEST2.xlsm
    Private Sub ComboBox1_Change()
    
    Dim ws As Worksheet
    Dim LR As Long
    
    Set ws = Sheets("test")
    
    LR = ws.Range("A365000").End(xlUp).Row
    
    'ComboBox1.Clear
    myVal = ComboBox1.Value
    
    ComboBox2.Clear
    ComboBox3.Clear
    
    For x = 2 To LR
        If myVal = ws.Cells(x, "A") Then
            ComboBox2.AddItem ws.Cells(x, "B")
            ComboBox3.AddItem ws.Cells(x, "C")
        End If
    Next x
    End Sub
    Any assistance appreciated.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Cascading/dependent combo boxes

    Try the attached.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    334

    Re: Cascading/dependent combo boxes

    Quote Originally Posted by jindon View Post
    Try the attached.
    I had some trouble at first using the workbook you created with a runtime 32809 error...which I believe is a result of a Microsoft Dec 2014 Update.
    After copying the code and pasting it into a workbook I created it all worked PERFECTLY!

    I searched for an explanation for your code and found this:

    http://www.mrexcel.com/forum/excel-q...ictionary.html

    Thanks Jindon !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Cascading/dependent combo boxes

    Thanks for the feed back and don't miss to copy "Workbook_Open()" in "ThisWorkbook" module....

+ 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. how to create dependent combo boxes, not cascading
    By batador in forum Access Tables & Databases
    Replies: 5
    Last Post: 03-16-2014, 08:52 AM
  2. cascading combo boxes
    By mehmet in forum Excel General
    Replies: 18
    Last Post: 02-23-2013, 07:57 AM
  3. cascading combo boxes
    By ranjaniramajuam in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 05-22-2008, 07:46 AM
  4. cascading combo boxes
    By dkinnz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-05-2007, 05:37 PM
  5. Cascading Combo Boxes
    By iamamonkeysoareyou@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2006, 05:20 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