I have a macro (thanks to Calypso) which deletes duplicate rows when the data in both Col A & Col B are the same as the following row. This macro keeps the bottom duplicate row. In other words, if I have Rows 1-5 that are duplicates, it keeps Row 5 rather than Row 1. I need the top row (in this case, Row 1) kept to be displayed rather than the bottom one. Is there a way to adjust the following macro so it keep the top row?
Range("A1").Select
Do While ActiveCell.Value <> ""
If ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then
If ActiveCell.Offset(0, 1).Value = ActiveCell.Offset(1, 1) Then
ActiveCell.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
Beep
End Sub
Thanks!
Janet
Range("A1").Select
Do While ActiveCell.Value <> ""
If ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then
If ActiveCell.Offset(0, 1).Value = ActiveCell.Offset(1, 1) Then
ActiveCell.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
Beep
End Sub
Thanks!
Janet