Hi...
I have a spreadsheet with over 300 rows. In column C I have a list of numbers that could range from 2 through 24. I wish to build my ComboBox in my userform with the list of unique numbers.
The following code works great building my ComboBox list however, it builds all of the numbers for all 300 plus rows even if there are numbers used multiple times.
Private Sub UserForm_Initialize()
With Sheets("Sheet1")
For Each c In .Range("C4", .Range("C" & Rows.Count).End(xlUp))
If c.Value <> "" Then ComboBox1.AddItem c.Value
Next c
End With
End Sub
Thanks for the help...
I have a spreadsheet with over 300 rows. In column C I have a list of numbers that could range from 2 through 24. I wish to build my ComboBox in my userform with the list of unique numbers.
The following code works great building my ComboBox list however, it builds all of the numbers for all 300 plus rows even if there are numbers used multiple times.
Private Sub UserForm_Initialize()
With Sheets("Sheet1")
For Each c In .Range("C4", .Range("C" & Rows.Count).End(xlUp))
If c.Value <> "" Then ComboBox1.AddItem c.Value
Next c
End With
End Sub
Thanks for the help...