| This example del dublicats in a list box, what you need to have is a command butten and a list box named list1 Function KillLBDupes(LB As listbox) Dim idxLoop As Integer Dim idxCheck As Integer idxLoop = 0 Do While idxLoop < LB.ListCount - 1 'Stop on 2nd from last item idxCheck = idxLoop + 1 Do While idxCheck <= LB.ListCount - 1 'Stop on last item If LB.list(idxCheck) = LB.list(idxLoop) Then LB.RemoveItem idxCheck 'We do not increment idxCheck here since the rest of the items are reindexed in the ListBox Else idxCheck = idxCheck + 1 End If Loop idxLoop = idxLoop + 1 Loop End Function |
Delete duplicates |
Express News India | Freelance ecommerce web development India