Hello, I'm wondering if there is an easy way of populating the unique records in an excel column to a listbox or combobox. I am thinking of doing something like
Which does not work right now, but will eventually. I just thought there must be a simpler way. Does anyone know if there is such a way?
Best regards, Johan
Code:
For r = 2 To 128
With CB_List
For n = 0 To .ListCount
If .List(n, 0) = Sheets("Testsheet").Cells(r, "U") Then
Exit For
End If
Next n
If n = .ListCount + 1 Then
.AddItem
.ColumnCount = 1
.List(.ListCount - 1, 0) = Sheets("Testsheet").Cells(r, "U")
End If
End With
Next r
Best regards, Johan
Comment