i can not figure out how to get this code to delete both rows that are the same instead of just the one.
Sub RemDupRows()
Dim lastcol As Integer, lastrow As Integer, i As Integer
Dim j As Integer, k As Integer, matchfound As Boolean
Dim rowMatch As Boolean
Application.ScreenUpdating = False
Range("A1").Select
Selection.End(xlToRight).Select
lastcol = ActiveCell.Column
Range("A1").Select
Selection.End(xlDown).Select
lastrow = ActiveCell.Row
For i = lastrow To 2 Step -1
matchfound = False
For j = i - 1 To 1 Step -1
rowMatch = True
For k = 1 To lastcol
If Cells(i, k) <> Cells(j, k) Then
rowMatch = False
k = lastcol
End If
Next k
If rowMatch Then
j = 1
matchfound = True
End If
Next j
If matchfound Then
Rows(i & ":" & i).EntireRow.Delete
End If
Next i
Range("A1").Select
End Sub
Sub RemDupRows()
Dim lastcol As Integer, lastrow As Integer, i As Integer
Dim j As Integer, k As Integer, matchfound As Boolean
Dim rowMatch As Boolean
Application.ScreenUpdating = False
Range("A1").Select
Selection.End(xlToRight).Select
lastcol = ActiveCell.Column
Range("A1").Select
Selection.End(xlDown).Select
lastrow = ActiveCell.Row
For i = lastrow To 2 Step -1
matchfound = False
For j = i - 1 To 1 Step -1
rowMatch = True
For k = 1 To lastcol
If Cells(i, k) <> Cells(j, k) Then
rowMatch = False
k = lastcol
End If
Next k
If rowMatch Then
j = 1
matchfound = True
End If
Next j
If matchfound Then
Rows(i & ":" & i).EntireRow.Delete
End If
Next i
Range("A1").Select
End Sub