'假设你已经有了一个数组:arr1
'用字典实现单条件数组元素计数
Set dicN = CreateObject("scripting.dictionary")
For j = 1 To UBound(arr1, 1)
If Not dicN.exists(arr1(j, 2)) Then
dicN.Add arr1(j, 2), 1
Else
dicN(arr1(j, 2)) = dicN(arr1(j, 2)) + 1
End If
Next
'输出计数,i 为变量
msgbox dicN(arr1(i, 2))