Results 1 to 5 of 5

Combobox dropdown to list range from sheet

Threaded View

nickmax1 Combobox dropdown to list... 12-27-2013, 05:40 AM
nickmax1 Re: Combobox dropdown to list... 12-27-2013, 06:23 AM
jaslake Re: Combobox dropdown to list... 12-27-2013, 12:05 PM
nickmax1 Re: Combobox dropdown to list... 12-30-2013, 05:33 AM
jaslake Re: Combobox dropdown to list... 12-30-2013, 12:35 PM
  1. #1
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Combobox dropdown to list range from sheet

    Please see attached. On the sheet Dec 13 there is a macro button (roughly on B13) called Filter Source. This opens up a form called "Operating Division" and on this form there are several dropdowns allowing the user to filter the sheet according to their preferences. This all works very well but I have recently added a dropdown for Broker (allocated to combobox8) but i cant get it to populate the dropdown with a selected range. (from sheet "Brokers" range B1:B500 (or B1 to the end of the list if you are clever enough to code that)

    I attempted the code below (the code has been disabled with a ' in front of it as it returns an error for me)

    Any help?



    Private Sub UserForm_Initialize()
        Dim Source As Variant
        Dim Status As Variant
        Dim RenNEW As Variant
        Dim UW As Variant
        Dim Status2 As Variant
        Dim BoundPrm As Variant
        Dim Likelihood As Variant
       ' Dim Brokers As Variant
            
        Dim i As Long
        Dim k As Long
        Dim j As Long
        Dim u As Long
        Dim s As Long
        Dim B As Long
        Dim L As Long
        'Dim Br As Long
        
        
        Source = Array("All", "Company", "Syndicate", "EU Corporate")
        RenNEW = Array("All", "New", "Renewal")
        Status = Array("All", "Dead", "Live")
        UW = Array("All", "AB", "NC", "LC", "RN", "DG")
        Status2 = Array("All", "Bound", "Quoted", "Firm", "NTU", "WIP", "Declined", "Non-Renewed", "Extended")
        BoundPrm = Array(">100000", "<100000")
        Likelihood = Array("All", "Green", "Amber", "Red")
        'Brokers = Brokers.Range("B1:B500")
        
        For i = LBound(Source) To UBound(Source)
            Me.ComboBox1.AddItem Source(i)
        Next i
        For k = LBound(Status) To UBound(Status)
            Me.ComboBox2.AddItem Status(k)
        Next k
        For j = LBound(RenNEW) To UBound(RenNEW)
            Me.ComboBox3.AddItem RenNEW(j)
        Next j
        For u = LBound(UW) To UBound(UW)
            Me.ComboBox4.AddItem UW(u)
        Next u
        For s = LBound(Status2) To UBound(Status2)
            Me.ComboBox5.AddItem Status2(s)
        Next s
        For B = LBound(BoundPrm) To UBound(BoundPrm)
            Me.ComboBox6.AddItem BoundPrm(B)
        Next B
        
        For L = LBound(Likelihood) To UBound(Likelihood)
            Me.ComboBox7.AddItem Likelihood(L)
        Next L
        
       ' For Br = LBound(Brokers) To UBound(Brokers)
       '     Me.ComboBox8.AddItem Likelihood(Br)
       ' Next Br
    End Sub
    Attached Files Attached Files
    Last edited by nickmax1; 12-27-2013 at 05:50 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help adding a dropdown list that calls back to a variable range on another sheet
    By Chris S. in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-30-2013, 03:30 PM
  2. Replies: 2
    Last Post: 08-31-2013, 03:15 PM
  3. Combobox Dropdown List only shows first Item
    By Guido Meng in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 09:49 PM
  4. dropdown list/ComboBox
    By tullemann in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-26-2011, 01:44 PM
  5. ComboBox dropdown for a large list
    By irish1two3 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-15-2007, 06:11 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