I'll give it one more try. Add a class module to your project. Leave the default name Class1.
Code for the class module (Class1)
Code:
Option Explicit
Public itemCount As Integer
Public itemDescripton As String
Then your form code
Code:
Private Sub Command1_Click()
Dim arrList(9) As String
Dim dict As Dictionary
Dim tItem As Class1
Dim i As Integer
Dim intCnt As Integer
Dim varEntry As Variant
arrList(0) = "AAA"
arrList(1) = "AAA"
arrList(2) = "AAA"
arrList(3) = "BBB"
arrList(4) = "CCC"
arrList(5) = "BBB"
arrList(6) = "BBB"
arrList(7) = "AAA"
arrList(8) = "AAA"
arrList(9) = "BBB"
Set dict = New Dictionary
For i = 0 To 9
If dict.Exists(arrList(i)) Then
Set tItem = dict(arrList(i))
tItem.itemCount = tItem.itemCount + 1
Set dict(arrList(i)) = tItem
Else
Set tItem = New Class1
tItem.itemCount = 1
tItem.itemDescripton = "Description of " & arrList(i)
dict.Add arrList(i), tItem
End If
Next
For Each varEntry In dict
Set tItem = dict(varEntry)
Debug.Print tItem.itemCount & " - " & varEntry & " - " & tItem.itemDescripton
Next varEntry
Set dict = Nothing
End Sub