For zz1 = 0 To List1.ListCount - 1
DoEvents
gg = ""
gg = List1.List(zz1)
For zz2 = zz1 To List1.ListCount - 1
If gg = List1.List(zz2) And gg <> "" Then
countit = countit + 1
List1.List(zz2) = ""
End If
Next zz2
If countit <> 0 Then
List2.AddItem gg & "," & countit
countit = 0
End If
Next zz1
thanks for not helping.If this isn't a typo, please explain how I didn't help.
Private Declare Function GetTickCount Lib "kernel32.dll" () As Long
Private Sub Command1_Click()
Dim Ticks As Long
Ticks = GetTickCount
For zz1 = 0 To List1.ListCount - 1
DoEvents
gg = ""
gg = List1.List(zz1)
For zz2 = zz1 To List1.ListCount - 1
If gg = List1.List(zz2) And gg <> "" Then
countit = countit + 1
List1.List(zz2) = ""
End If
Next zz2
If countit <> 0 Then
List2.AddItem gg & "," & countit
countit = 0
End If
Next zz1
Ticks = GetTickCount - Ticks
MsgBox Ticks / 1000
End Sub
Private Sub Command2_Click()
Dim Ticks As Long
Ticks = GetTickCount
countit = 0
For zz1 = 0 To List1.ListCount - 1
gg = List1.List(zz1)
If gg <> "" Then
For zz2 = zz1 To List1.ListCount - 1
If gg = List1.List(zz2) Then
countit = countit + 1
List1.List(zz2) = ""
End If
Next zz2
If countit <> 0 Then
List2.AddItem gg & "," & countit
countit = 0
End If
End If
Next zz1
Ticks = GetTickCount - Ticks
MsgBox Ticks / 1000
End Sub
Private Sub Command3_Click()
List1.Clear
List2.Clear
For i = 1 To 10000
List1.AddItem CInt(Rnd * 100)
Next i
End Sub
Open in new window