|
如果加上日期,那么汇总的项会有很多。其实不要日期,修改程序也是很简单的。最后,“那后续开始分析么”,前面我对你的分析还是不太了解,变量这么多,怎么作图尼,怎么个分析,能够有个模板。个热闹理解力不是很好。
SH-SKU.zip
(1.01 MB, 下载次数: 42)
- Sub 汇总无日期()
- Dim Arr, Brr(), drow&, i&, j&, d, k, t, sstr
- Set d = CreateObject("scripting.dictionary")
- With Worksheets("sheet1")
- drow = .[a1000000].End(3).Row
- Arr = .Range("a2:g" & drow)
- For i = 1 To UBound(Arr)
- sstr = Arr(i, 1) & "@" & Arr(i, 2) & "@" & Arr(i, 3) & "@" & Arr(i, 4)
- d(sstr) = d(sstr) + Arr(i, 7)
- Next
- End With
- k = d.keys
- t = d.items
- With Worksheets("汇总")
- ReDim Brr(1 To d.Count, 1 To 7)
- For i = 0 To d.Count - 1
- Brr(i + 1, 1) = k(i)
- For j = 0 To 3
- Brr(i + 1, j + 2) = Split(k(i), "@")(j)
- Next
- Brr(i + 1, 6) = t(i)
- Next
- .Range("a2:i65536").ClearContents
- .[a2].Resize(d.Count, 7) = Brr
- End With
- MsgBox "汇总完成"
- End Sub
复制代码 |
|