Hi annes and welcome to the forum,
I don't think you need VBA for this. A helper column with this at the top and then pull it down might work.
See the attached.![]()
=COUNTIF(A$1:A2,A2)
All helper column numbers of 2 are duplicates of above. You could sort by the helper and then delete the dups if that is what you want.
Bookmarks