|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 去重统计()
For i = 2 To Range("a65536").End(xlUp).Row
Cells(i, 4) = Cells(i, 1) & Cells(i, 2)
Cells(i, 5) = Application.CountIf(Range(Cells(2, 4), Cells(i, 4)), Cells(i, 4))
Cells(i, 3) = Application.CountIf(Range(Cells(2, 4), Cells(Range("a65536").End(xlUp).Row, 4)), Cells(i, 4))
Next
For i = Range("a65536").End(xlUp).Row To 2 Step -1
If Cells(i, 5) > 1 Then Rows(i).Delete Shift:=xlUp
Next
Columns("D:E").Delete Shift:=xlToLeft
End Sub |
|