Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Function BorrarRepetidos() As Long
- ' -- Variables
- Dim i As Long
- Dim j As Long
- Dim Ret As Long ' -- total de items que se eliminan
- With frmProcessList.List1
- ' -- Recorrer todos los items
- For i = 1 To .ListCount '.ListItems.Count
- ' -- Comparar uno a uno con todos los demás
- For j = i + 1 To .ListCount
- 'If .ListItems.Item(i) = .ListItems.Item(j) Then
- If .List(i) = .List(j) Then
- ' -- Si es igual eliminar
- .RemoveItem j
- j = j - 1
- Ret = Ret + 1
- End If
- If j = .ListCount Then
- Exit For
- End If
- Next
- If i = .ListCount Then
- BorrarRepetidos = Ret
- Exit Function
- End If
- Next
- End With
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement