|
本帖最后由 vbee 于 2018-6-18 11:37 编辑
Sub vbee()
Set d = CreateObject("scripting.dictionary")
arr = Sheet1.UsedRange
brr = Sheet2.Range("a1:b" & UBound(arr))
For i = 1 To UBound(arr)
For j = 3 To UBound(arr, 2)
If arr(i, j) <> "" Then d(arr(i, j)) = d(arr(i, j)) + 1
Next j
krr = d.keys
mrr = d.items
For k = 0 To UBound(krr) - 1
dd = Application.Max(mrr)
If mrr(k) = Application.Max(mrr) Then
brr(i, 2) = mrr(k)
brr(i, 1) = krr(k)
Exit For
End If
Next k
d.RemoveAll
Next i
Sheet2.Range("a1:b" & UBound(arr)).Clear
Sheet2.Range("a1:b" & UBound(arr)) = brr
End Sub
|
评分
-
1
查看全部评分
-
|