|
参与一下。。。
- Sub ykcbf() '//2024.4.12
- Set d = CreateObject("Scripting.Dictionary")
- arr = Sheets("Sheet1").UsedRange
- For i = 2 To UBound(arr)
- s = CStr(arr(i, 7))
- If Val(arr(i, 3)) + Val(arr(i, 4)) + Val(arr(i, 5)) Then
- If Not d.exists(s) Then
- d(s) = Array(s, 1, Val(arr(i, 3)), Val(arr(i, 4)), Val(arr(i, 5)))
- Else
- t = d(s)
- t(1) = t(1) + 1
- For x = 2 To 4
- t(x) = t(x) + Val(arr(i, x + 1))
- Next
- d(s) = t
- End If
- End If
- Next
- With Sheets("Sheet2")
- .UsedRange.Offset(1).Clear
- .[a2].Resize(d.Count, 5) = Application.Rept(d.Items, 1)
- .[a2].Resize(d.Count, 5).Borders.LineStyle = 1
- .[a2].Resize(d.Count, 5).Sort .[a2], 1
- End With
- Set d = Nothing
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|