|
参与一下。。。
- Sub ykcbf() '//2024.8.2
- Set d = CreateObject("Scripting.Dictionary")
- r = Cells(Rows.Count, 1).End(3).Row
- arr = [a1].Resize(r, 6)
- ReDim brr(1 To r, 1 To 2)
- For i = 2 To UBound(arr)
- s = arr(i, 1)
- If Not d.exists(s) Then
- m = m + 1
- d(s) = m
- brr(m, 1) = s
- Sum = 0
- For j = 2 To UBound(arr, 2)
- If Val(arr(i, j)) Then Sum = Sum + 1
- Next
- brr(m, 2) = Sum
- Else
- r = d(s)
- Sum = 0
- For j = 2 To UBound(arr, 2)
- If arr(i, j) <> Empty Then Sum = Sum + 1
- Next
- brr(r, 2) = brr(r, 2) + Sum
- End If
- Next
- [o3:p1000] = ""
- [o3].Resize(m, 2) = brr
- MsgBox "OK!"
- End Sub
复制代码
|
|