|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub aa()
Set d = CreateObject("Scripting.Dictionary")
ar = Sheet2.Range("a2:ag" & Sheet2.Range("a65536").End(xlUp).Row)
Sheet3.Range("f2:u" & Range("a65536").End(xlUp).Row).ClearContents
br = Sheet3.Range("a1:u" & Range("a65536").End(xlUp).Row)
For i = 6 To UBound(br, 2)
If InStr(br(1, i), "/") <> 0 Then
b = Split(br(1, i), "/")
For j = 0 To UBound(b)
d(b(j)) = i
Next
Else
d(br(1, i)) = i
End If
Next
For i = 2 To UBound(br)
d(br(i, 1)) = i
Next
For i = 1 To UBound(ar)
For j = 3 To 7
r = d(ar(i, j))
If r <> "" Then
For k = 20 To 25 Step 2
s = d(ar(i, k))
If s <> "" Then
br(r, s) = br(r, s) + ar(i, k + 1)
End If
Next
End If
Next
Next
Sheet3.Range("a1").Resize(UBound(br), UBound(br, 2)) = br
End Sub
为了测试加了个sheet3。 |
评分
-
1
查看全部评分
-
|