Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t3945
- ---------------------------------
- Sub Remove_Duplicates_Keep_Last_Entry()
- Dim s As String, m As Long, r As Long
- Application.ScreenUpdating = False
- s = Empty: m = Cells(Rows.Count, "C").End(xlUp).Row
- For r = m To 2 Step -1
- If Application.CountIf(Range("C" & m & ":C" & r), Cells(r, 3).Value) <> 1 Then
- s = s & IIf(s <> Empty, ",", "") & Cells(r, 1).Address(0, 0)
- End If
- Next r
- If s <> Empty Then
- Range(s).EntireRow.Delete
- End If
- Application.ScreenUpdating = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement