P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 10th, 2003 09:01 AM Post subject: Remove duplicates in Listbox/Combobox |
|
|
| Code: | Private Sub RemoveDuplicates(obj As Object)
Dim i As Long, j As Long
With obj
For i = 0 To .ListCount - 1
For j = .ListCount To (i + 1) Step -1
If .List(j) = .List(i) Then
.RemoveItem j
End If
Next
Next
End With
End Sub |
_________________ No one is completely useless. They can at least be an example of what to avoid.
Last edited by P.T.A.M. on Dec 18th, 2003 01:46 PM; edited 1 time in total |
|