|
- Sub aa()
- Dim arr, i As Long, j As Long
- Dim Co As Long, Ro As Long
- Dim arr1
- Set d = CreateObject("Scripting.Dictionary")
- Co = Range("C1").End(xlToRight).Column
- For i = 3 To Co
- Ro = IIf(Cells(65536, i).End(xlUp).Row > Ro, Cells(65536, i).End(xlUp).Row, Ro)
- Next i
- arr = Range(Cells(2, 3), Cells(Ro, Co))
- For i = 1 To UBound(arr)
- For j = 1 To UBound(arr, 2)
- If arr(i, j) <> "" Then
- d(arr(i, j)) = d(arr(i, j)) + 1
- End If
- Next j
- Next i
- Range("A2:B" & [A65536].End(xlUp).Row + 1).ClearContents
- Range("A2").Resize(d.Count, 1) = Application.Transpose(d.Keys)
- Range("B2").Resize(d.Count, 1) = Application.Transpose(d.Items)
- End Sub
复制代码 |
|