Hi
I have a sheet called "Data" and from cell A2 I have many numbers like:
30023
30028
30102
30001
and so on, but in the same list the number can apper many times like
30023
30028
30001
30023
30089
30001
So my question are, how can I fill a combobox, the list of number but if the number has more than one I only want to add it one time.
I have this code on a button
I have a sheet called "Data" and from cell A2 I have many numbers like:
30023
30028
30102
30001
and so on, but in the same list the number can apper many times like
30023
30028
30001
30023
30089
30001
So my question are, how can I fill a combobox, the list of number but if the number has more than one I only want to add it one time.
I have this code on a button
Code:
Private Sub cmdFillCBO_Click()Dim xlSheet As Worksheet
Dim xlInfo As Worksheet
Dim i As Integer
Dim iRow As Integer
Set xlSheet = Worksheets("Data")
Set xlInfo = Worksheets("Info")
iRow = Worksheets("Data").Cells(Rows.Count, 1).End(xlUp).Row
With xlSheet
For i = 2 To iRow
If .Cells(i, 1).Value = "" Then
Exit For
End If
cboABO.AddItem (.Cells(i, 1).Value)
Next i
End With
End Sub