Remove duplicates from a ListBox

Function RemoveDuplicates(list as ListBox, column as Integer) As Integer Dim i,j as Integer Dim duplicatesRemoved as Integer = 0 While i<list.ListCount j = i+1 while j<list.ListCount if list.Cell(i,column) = list.Cell(j,column) Then list.RemoveRow(j) duplicatesRemoved = duplicatesRemoved + 1 else j = j+1 end if wend i=i+1 wend return duplicatesRemoved End Function

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.