josef
11-07-2010, 10:53 PM
I have found this code here , i would like to know is it possible to copy entire row instead of deleting ?I am new to vba ,can someone help me please .thank you.
Sub DeleteDups()
Dim x AsLong
Dim LastRow AsLong
LastRow = Range("A65536").End(xlUp).Row
For x = LastRow To 1 Step -1
If Application.WorksheetFunction.CountIf(Range("A1:A" & x), Range("A" & x).Text) > 1 Then
Range("A" & x).EntireRow.Delete
EndIf
Next x
End Sub
Sub DeleteDups()
Dim x AsLong
Dim LastRow AsLong
LastRow = Range("A65536").End(xlUp).Row
For x = LastRow To 1 Step -1
If Application.WorksheetFunction.CountIf(Range("A1:A" & x), Range("A" & x).Text) > 1 Then
Range("A" & x).EntireRow.Delete
EndIf
Next x
End Sub