|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
准式字典...by.准提部林
Sub Test_A1()
Dim Arr, Brr, xD, i&, T$, T1$, T2$, N&, R&, Rk$
Set xD = CreateObject("scripting.dictionary")
Arr = Range([d1], [b65536].End(3))
ReDim Brr(1 To UBound(Arr), 1 To 3)
For i = 2 To UBound(Arr)
T1 = Arr(i, 1): T2 = Arr(i, 2): T = T1 & "\" & T2
R = xD(T1): Rk = Left(",", R)
If R = 0 Then N = N + 1: R = N: xD(T1) = N: Brr(N, 1) = T1
If xD(T) = 0 Then Brr(R, 2) = Brr(R, 2) & Rk & T2: xD(T) = 1
Brr(R, 3) = Brr(R, 3) + Arr(i, 3)
Next i
[f2].Resize(N, 3) = Brr
End Sub
|
评分
-
1
查看全部评分
-
|