PDA

View Full Version : Populate combobox only with values that column cell is empty



Emoncada
09-08-2015, 01:36 PM
I want to populate a combobox list with only values from Column A:A that have Column F:F blank.

So if cell

F2 = ""
F3 = ""
F4 = "Purple"
F5 = ""

I want Combobox.additem = Range("A2, A3, A5").values


Something like that hope that explains my goal

Can this be done?

mancubus
09-08-2015, 01:47 PM
userform combo?

one way:



Private Sub UserForm_Initialize()

With Worksheets("Sheet1") 'change Sheet1 to suit
For i = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
If .Cells(i, 6).Value = "" Then ComboBox1.AddItem .Cells(i, 1).Value 'change ComboBox1 to suit
Next i
End With

End Sub