|
Sub Click()
Dim i
Application.ScreenUpdating = False
'1)地址
Sheets(1).Select
i = Range("c65536").End(xlUp).Row
If i < 5 Then End
i = ActiveSheet.Name & "!" & Range("c4:i" & i).Address(, , xlR1C1)
'2)合并计算
Sheets(2).Select
Cells = ""
[b1] = "客户"
[b1].Consolidate Sources:=i, Function:=xlSum, TopRow:=True, LeftColumn:=True
Range("c:d,g:g").Delete
'3)序号
[a1] = "序号"
For i = 2 To Range("b65536").End(xlUp).Row
Cells(i, 1) = i - 1
Next
'4)合计
Cells(i, 1) = "合计"
Cells(i, 3) = "=sum(c2:c" & i - 1 & ")"
Cells(i, 3).AutoFill Destination:=Range("c" & i & ":e" & i), Type:=xlFillValues
Range("a1").CurrentRegion.ColumnWidth = 15
End Sub
提取不重复客户名合计对应三列数据2.rar
(17.48 KB, 下载次数: 17)
|
评分
-
查看全部评分
|