I'm trying to set up a way to go through a database that I have in Excel and delete rows that have duplicate data. I've based the following code on a sample that I found in this forum, but because the database that I'm going through will often have more than 5,000 rows, this code can take several minutes to fully execute.
I'm wondering if there is another approach to this that will not require the use of "ActiveCell" in the code, and if so, will it provide for a much faster solution?
Essentially, if there is more than one row that has the same combination of values in Columns A and B, then all but one of those rows should be deleted.
Thank you for any help that you can provide.
I'm wondering if there is another approach to this that will not require the use of "ActiveCell" in the code, and if so, will it provide for a much faster solution?
Essentially, if there is more than one row that has the same combination of values in Columns A and B, then all but one of those rows should be deleted.
Code:
ReRun:
Do Until ActiveCell.Offset(1, 0).Text = ""
If ActiveCell.Text = ActiveCell.Offset(1, 0).Text And ActiveCell.Offset(0, 2).Value = ActiveCell.Offset(1, 2).Value Then
ActiveCell.Offset(1, 0).EntireRow.Delete
GoTo ReRun
End If
ActiveCell.Offset(1, 0).Activate
Loop