|
楼主 |
发表于 2020-4-16 22:01
|
显示全部楼层
Sub 按钮2_Click()
Set d = CreateObject("scripting.dictionary")
arr = Sheets("原始数据").[a1].CurrentRegion
Application.ScreenUpdating = False
ActiveSheet.UsedRange.ClearContents
[a1] = "客户姓名"
For j = 2 To UBound(arr)
If Not d.exists(arr(j, 1)) Then
r = Cells(Rows.Count, 1).End(3).Row + 1
d(arr(j, 1)) = r
Cells(r, 1) = arr(j, 1)
End If
If Not d.exists(arr(j, 2)) Then
c = Cells(1, Columns.Count).End(xlToLeft).Column + 1
d(arr(j, 2)) = c
Cells(1, c) = arr(j, 2)
End If
Cells(d(arr(j, 1)), d(arr(j, 2))) = arr(j, 3) + Cells(d(arr(j, 1)), d(arr(j, 2)))
Next j
Application.ScreenUpdating = True
End Sub
|
评分
-
1
查看全部评分
-
|