this is what im using to remove duplicates from listbox but if i have for example three A's and 3 B's and when i click to deduple it will only remove one A and one B so i would still have some duped to fix this i would have to keep on clicking dedupe how can i fix this?VB Code:
Private Sub RemoveDuplicates(list As ListBox) Dim i As Integer, x As Integer For i = 0 To list.ListCount - 1 For x = 0 To list.ListCount - 1 If i <> x Then If list.list(i) = list.list(x) Then list.RemoveItem (x) End If End If Next x Next i End Sub Private Sub Cmdremove_Click() Call RemoveDuplicates(List1) End Sub




Reply With Quote