-2

I have a spreadsheet with around 15K rows of data. I have duplicate values in this spreadsheet that consist of a combination of columns A & B. How can I remove the duplicates from this spreadsheet based on what is in column C? I would like to delete duplicates, but I would only like to delete the duplicates that have a value of 'N/A' in column C (leaving the rows that contains 'no ip proxy-arp' in column c)

1.1.1.1,interface GigabitEthernet0/1,no ip proxy-arp,Duplicate
1.1.1.1,interface GigabitEthernet0/1,N/A,Original
1.1.1.1,interface GigabitEthernet0/1.10,N/A,Original
1.1.1.1,interface GigabitEthernet0/1.26,N/A,Original
1.1.1.1,interface GigabitEthernet0/2,no ip proxy-arp,Duplicate
1.1.1.1,interface GigabitEthernet0/2,N/A,Original
1.1.1.1,interface GigabitEthernet0/2.10,no ip proxy-arp,Duplicate
1.1.1.1,interface GigabitEthernet0/2.10,N/A,Original
1.1.1.1,interface GigabitEthernet0/2.26,no ip proxy-arp,Duplicate
1

This just happens to be in my clipboard -

Sub dupl()
Dim c As Range

For Each c In Range("A1:A467")

If c.Value = c.Offset(1).Value And c.Offset(, 1).Value = c.Offset(1, 1).Value And c.Offset(1, 2) = "N/A" Then
    c.Offset(1).EntireRow.Delete
End If
Next

End Sub

Make sure you sort column A A-Z and column B A-Z and change the range to the appropriate range.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.