[excel]对重复行汇总累计,不重复行直接统计
2012-06-18 12:45
330 查看
Private Sub CommandButton1_Click()
Dim i%, K%
Dim d As Object
Range("D2:F11").ClearContents
Set d = CreateObject("Scripting.Dictionary")
For i = 2 To 11
If d.Exists(Cells(i, 1).Value) = False Then
d.Add Cells(i, 1).Value, 1
Cells(d.Count + 1, "D") = d.Count '给不重复加序号
Cells(d.Count + 1, "e") = Cells(i, 1) '列出不重复项
Cells(d.Count + 1, "F") = Cells(i, 2) '列出不重复第一次的B列数值
Else
K = Application.Match(Cells(i, 1), d.keys, 0) '找到重复项的索引
Cells(K + 1, "F") = Cells(K + 1, "F") + Cells(i, 2) '累加数值
End If
Next i
End Sub
相关文章推荐
- Excel VBA 根据日期汇总统计另一字段非重复值的个数
- Excel VBA 根据筛选条件自动汇总统计(for 铁虎)
- excel 分类汇总 如何只复制统计结果
- Excel-统计不重复数据的个数,设置单元格不允许出现重复数据
- Excel在统计分析中的应用—第十章—方差分析-有重复双因素方差分析工具
- excel中如何实现统计一列中不重复的值的个数
- excel中统计重复行countif
- pandas带有重复值的轴索引,汇总和计算描述统计,相关系数与协方差
- excel统计不重复的单元格数
- 直接在excel里面去除重复行
- Excel VBA初次应用:统计小组成员每周开的bug并汇总。
- EXCEL杂记:统计重复列的个数
- Excel如何直接根据数据画出统计图
- 小猫统计:对于分组查询结果,直接生成约60种excel图表
- Excel在统计分析中的应用—第十章—方差分析-无重复双因素方差分析
- Excel在统计分析中的应用—第十章—方差分析-无重复双因素方差分析工具
- Excel 统计符合条件不重复的个数
- 1364:D. 重复成绩统计 (改编)
- Excel使用技巧 查找重复值
- 去除字符串中的重复字符——方法汇总和性能测试