Results 1 to 4 of 4

Cascading Combobox Dropdowns

Threaded View

  1. #1
    Registered User
    Join Date
    03-18-2015
    Location
    Alaska
    MS-Off Ver
    365
    Posts
    1

    Cascading Combobox Dropdowns

    Hello,

    I would consider myself very new to visual basic, but after a lot of research, I have been unable to find an answer to my question. I have been able to watch some youtube videos of cascading comboboxes, but I havent been able to find one that explained how to have 4 conditional boxes. I figure that there is an and statement that needs to be thrown in there, but I am just not sure on how to do it. Any help would be appreciated, and if you would prefer a different type of example attached I can provide that.

    Thank you very much.

    My code is

    Private Sub ComboBoxConnectionBrand_LostFocus()
    
    Dim csheet As Worksheet
    Set csheet = ThisWorkbook.Sheets("connections")
    
    Me.ComboBoxSize.Clear
    Me.ComboBoxWeight.Clear
    Me.ComboBoxConnection.Clear
    
    For Each cell In ThisWorkbook.Sheets("connections").Range("brand")
        If Me.ComboBoxConnectionBrand = cell Then
            Me.ComboBoxSize.AddItem cell.Offset(0, 1)
        End If
    Next cell
    
    Me.ComboBoxSize = ""
    
    End Sub
    
    
    
    Private Sub comboboxsize_lostfocus()
    
    Dim csheet As Worksheet
    Set csheet = ThisWorkbook.Sheets("connections")
    Dim ConnBrand As String
    ConnBrand = Me.ComboBoxConnectionBrand.Value
    
    Me.ComboBoxWeight.Clear
    Me.ComboBoxConnection.Clear
    
    For Each cell In ThisWorkbook.Sheets("connections").Range("size")
    
        
        If Me.ComboBoxSize = cell Then
               Me.ComboBoxWeight.AddItem cell.Offset(0, 1)
        End If
        
    Next cell
    
    Me.ComboBoxWeight = ""
    
    End Sub
    
    Private Sub comboboxweight_lostfocus()
    
    Dim csheet As Worksheet
    Set csheet = ThisWorkbook.Sheets("connections")
    
    Me.ComboBoxConnection.Clear
    
    For Each cell In ThisWorkbook.Sheets("connections").Range("weight")
        If Me.ComboBoxWeight = cell Then
            Me.ComboBoxConnection.AddItem cell.Offset(0, 1)
        End If
    Next cell
    
    Me.ComboBoxConnection = ""
    
    
    End Sub
    Attached Files Attached Files
    Last edited by jeepbro1; 03-18-2015 at 07:01 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Cascading Dropdowns - 4 Levels
    By joannakf in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-04-2014, 09:01 AM
  2. [SOLVED] Creating two cascading dropdowns from one variable choice.
    By Emmaly in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-13-2013, 11:27 AM
  3. Multiple cascading dropdowns
    By kokorota in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-21-2013, 09:22 AM
  4. Multiple Cascading Dropdowns
    By Emmaly in forum Excel General
    Replies: 6
    Last Post: 11-03-2011, 07:25 AM
  5. Cascading Dropdowns from table
    By jrjeffcoat64 in forum Excel General
    Replies: 1
    Last Post: 09-06-2011, 02:02 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