Then please try the Code below:
Option Explicit
Public Sub DeleteDuplicateRows()
Dim A As Long
Dim B As Long
Dim C As Variant
Dim Rng As Range
Dim Lr As Long
Lr = Sheet2.Range("A4:A" & Rows.Count).End(xlUp).Row
On Error GoTo EndMacro
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Sheet2.Range("A4:Z4" & Lr).Select
Set Rng = Application.Intersect(ActiveSheet.UsedRange, _
ActiveSheet.Columns(ActiveCell.Column))
Application.StatusBar = "Processing Row: " & Format(Rng.Row, "#,##0")
B = 0
For A = Rng.Rows.Count To 2 Step -1
If A Mod 500 = 0 Then
Application.StatusBar = "Processing Row: " & Format(A, "#,##0")
End If
C = Rng.Cells(A, 1).Value
If C = vbNullString Then
If Application.WorksheetFunction.CountIf(Rng.Columns(1), vbNullString) > 1 Then
Rng.Rows(A).EntireRow.Delete
B = B + 1
End If
Else
If Application.WorksheetFunction.CountIf(Rng.Columns(1), C) > 1 Then
Rng.Rows(A).EntireRow.Delete
B = B + 1
End If
End If
Next A
EndMacro:
Application.StatusBar = False
Application.Calculation = xlCalculationAutomatic
MsgBox "Duplicate Rows Deleted:= " & CStr(B), vbOKOnly, ("Confirmation of Deletions")
Sheet2.Range("A4").Select
Application.ScreenUpdating = True
End Sub
Regards.
Bookmarks