Hello community, I hope y'all doing fine. I need some help with the following task:
I have a 13k rows file, but with at least 2000 duplicates, and I need to delete them but considering column N.
I need a VBA code that deletes all duplicates on column A that are empty on column N. I tried the following:
But the "IsEmpty" part seems to be not working.
Feel free to either correct my code, or write a new one instead.
Thank you in advance!
I have a 13k rows file, but with at least 2000 duplicates, and I need to delete them but considering column N.
I need a VBA code that deletes all duplicates on column A that are empty on column N. I tried the following:
VBA Code:
Dim ColorRng As Range
Dim ColorCell As Range
Dim hoja As Worksheet
Set hoja = ActiveSheet
Set ColorRng = hoja.Range("A2:AB" & Cells(Rows.Count, "A").End(xlUp).Row)
For Each ColorCell In ColorRng
If WorksheetFunction.CountIf(ColorRng, ColorCell.Value) > 1 And IsEmpty(Range("N2:N" & Cells(Rows.Count, "A").End(xlUp).Row)) = True Then
ColorCell.EntireRow.Delete
Else
ColorCell.Interior.ColorIndex = xlNone
End If
Next
But the "IsEmpty" part seems to be not working.
Feel free to either correct my code, or write a new one instead.
Thank you in advance!