|
Sub 系统数据分析()
Dim crr, brr
Set d = CreateObject("Scripting.Dictionary") '设置d为字典对象
arr = Range("A1").CurrentRegion
For i = 2 To UBound(arr)
d(arr(i, 1) & "/" & arr(i, 2)) = d(arr(i, 1) & "/" & arr(i, 2)) + arr(i, 3)
Next
endrow = Sheets("系统数据分析结果").Range("a1000000").End(xlUp).Row + 1
Sheets("系统数据分析结果").Cells(endrow, 1).Resize(d.Count, 1) = InputBox("请输入月份")
crr = d.Keys
ReDim brr(0 To UBound(crr), 0 To 1)
For j = 0 To UBound(crr)
brr(j, 0) = Split(crr(j), "/")(0)
brr(j, 1) = Split(crr(j), "/")(1)
Next
Sheets("系统数据分析结果").Cells(endrow, 2).Resize(d.Count, 2) = brr
Sheets("系统数据分析结果").Cells(endrow, 4).Resize(d.Count, 1) = Application.Transpose(d.items)
Sheets("系统数据分析结果").Select
End Sub
|
|