|
更正错误。。。
- Sub ykcbf() '//2024.11.24
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Set d = CreateObject("Scripting.Dictionary")
- ReDim brr(1 To 20000, 1 To 100)
- On Error Resume Next
- With Sheets("数据源")
- r = .Cells(Rows.Count, 1).End(3).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c)
- End With
- 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
- End If
- r = d(arr(i, 1))
- rq = CDate(arr(i, 2))
- c = Month(rq) + 1
- brr(r, c) = brr(r, c) + Val(arr(i, 8))
- Next
- With Sheets("统计查看")
- .[a3:n20000].Clear
- .[a2].Resize(1, 14).Interior.Color = 49407
- With .[a3].Resize(m, 14)
- .Value = brr
- .Borders.LineStyle = 1
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- End With
- For i = 3 To m + 2
- .Cells(i, 14) = Application.Sum(.Cells(i, 2).Resize(, 12))
- Next
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|