下面我们来看看代码
Sub test()
Dim arr, brr, crr, dic As Object
Set dic = CreateObject("scripting.dictionary")
arr = Range("A1").CurrentRegion.Value
For i = 2 To UBound(arr)
brr = Split(arr(i, 1), "、")
For j = 0 To UBound(brr)
dic(brr(j) & arr(i, 2)) = dic(brr(j) & arr(i, 2)) + 1
Next j
Next i
brr = Range("D2").CurrentRegion.Value
For m = 2 To UBound(brr)
For n = 2 To UBound(brr, 2)
brr(m, n) = dic(brr(m, 1) & brr(1, n))
If brr(m, n) = "" Then brr(m, n) = 0
Next n
Next m
Range("D2").CurrentRegion.Value = brr
End Sub
好了,本期教程就到这里啦,走过路过的点个关注分享一下吧,谢谢啦