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
Bookmarks