I have a macro which deletes duplicate rows if the data in Column A is the same. Is there a macro to delete duplicate rows (keeping the last row for each duplicate) when the data in BOTH Column A and Column B (information in other columns will vary) are the same? The macro I'm using now (which I received from this forum) for deleting duplicates when only Column A is the same is as follows -
rowx=1
Do Until Cells(rowx+1,1).Value=""
If UCase(Cells(rowx,1).Value)=UCase(Cells(rowx+1,1).Value) Then
Cells(rowx+1,1).EntireRow.Delete
Else
rowx=rowx+1
End If
Loop
Beep
End Sub
Is there a way to adjust the macro so it checks cells in both Column A and Column B and deletes the rows if the information in those cells are duplicates?
Thanks!
rowx=1
Do Until Cells(rowx+1,1).Value=""
If UCase(Cells(rowx,1).Value)=UCase(Cells(rowx+1,1).Value) Then
Cells(rowx+1,1).EntireRow.Delete
Else
rowx=rowx+1
End If
Loop
Beep
End Sub
Is there a way to adjust the macro so it checks cells in both Column A and Column B and deletes the rows if the information in those cells are duplicates?
Thanks!