Hi All,
I have the code below that works perfectly to delete rows that are duplicated.
Is it possible to change the code so it deletes from the top down instead of the usual bottom up. This is because sometimes the duplicates that are lower down the imported list are updated and do have more info than the original.
So deleting downwards would be the best option but I'm not sure if this can be done and how?
Private Sub CommandButton22_Click()
LR = Cells(Rows.Count, "B").End(xlUp).Row
For i = LR To 2 Step -1
If WorksheetFunction.CountIf(Range("B:B"), Cells(i, "B").Value) > 1 Then
Rows(i).EntireRow.Delete
End If
Next i
End Sub
Thanks in advance
Craig.
I have the code below that works perfectly to delete rows that are duplicated.
Is it possible to change the code so it deletes from the top down instead of the usual bottom up. This is because sometimes the duplicates that are lower down the imported list are updated and do have more info than the original.
So deleting downwards would be the best option but I'm not sure if this can be done and how?
Private Sub CommandButton22_Click()
LR = Cells(Rows.Count, "B").End(xlUp).Row
For i = LR To 2 Step -1
If WorksheetFunction.CountIf(Range("B:B"), Cells(i, "B").Value) > 1 Then
Rows(i).EntireRow.Delete
End If
Next i
End Sub
Thanks in advance
Craig.