Is there a way to delete only one part of the duplicates

Occasional Visitor


I know that what I'm trying to do can seem a bit strange, but I'm trying to get some data about my bus network, and need a list of stops that's not too big to get data from.

I'm trying to keep 1/10 of all bus stops of each line, deleting the others. I thought of using the “Remove duplicates” feature, but it will delete every duplicate and not a part of them.


Do you know if there's any way to do that?


1 Reply


How to remove all duplicates but keep only one in Excel?

1. Select the data list you need, and click Data > Remove Duplicates.

2. Then in Remove Duplicates dialog, check the column name that you want to remove duplicates from, and if your data has header, check My data has headers option, too.

3. Click OK. And a dialog pops out to tell you how many duplicates have been removed, just close it. And now all duplicates have been remove but keep only one in the list.


Remove all duplicates but keep only one with VBA

Sub RemoveAllDeplicateButOne()
    Dim LR As Long: LR = Range("A" & Rows.Count).End(xlUp).Row
    ActiveSheet.Range("A1:A" & LR).RemoveDuplicates Columns:=1, Header:=Name
End Sub

...more informations you will find in the upper link.


Hope I was able to help you with this information.



I know I don't know anything (Socrates)