Sub DelDup()
' 當 A 欄的內容重覆時,刪除 A欄
' 速度很慢,絕對比不上樞紐分析表
Set DupRng = Columns("A")
col = "A"
'EndRows = ActiveSheet.Range(col & "65536").End(xlUp).Row
EndRows = ActiveSheet.UsedRange.Rows.Count
aa = 1
Do While aa <= EndRows
Dup_Count = Application.WorksheetFunction.CountIf(DupRng, Cells(aa, col))
If Dup_Count > 1 Then Cells(aa, col).EntireRow.Delete
aa = aa + 1
Loop
End Sub
沒有留言:
張貼留言