|
Option Explicit
Sub TEST6()
Dim ar, i&, dic As Object, strKey$, wks As Worksheet
Application.ScreenUpdating = False
Set dic = CreateObject("Scripting.Dictionary")
For Each wks In Worksheets
If wks.Name <> "结果" Then
ar = wks.[A1].CurrentRegion.Value
If IsArray(ar) Then
For i = 2 To UBound(ar)
strKey = ar(i, 2)
dic(strKey) = dic(strKey) + 1
Next i
End If
End If
Next
ar = Range("B2", Cells(Rows.Count, "B").End(xlUp)).Value
For i = 1 To UBound(ar)
strKey = ar(i, 1)
ar(i, 1) = dic(strKey)
Next i
[D2].Resize(UBound(ar)) = ar
Set dic = Nothing
Application.ScreenUpdating = True
Beep
End Sub
|
评分
-
1
查看全部评分
-
|