I'm trying to write a peice of code that will go through a table of records, and based on two fields where that data matches, it deletes all other records and just keeps those records where the two fields have dups. I've posted my code below. Can someone help me get this right?
Dim rng As Range
Dim Celle As Range
Set rng = Range("b2:b" & Cells(65536, "b").End(xlUp).Row)
For Each Celle In rng
If Celle = Celle.Offset(-1, 0) And Celle.Offset(0, 2) <> Celle.Offset(-1, 2) Then
If Celle <> Celle.Offset(-1, 0) Then