I have a Google Sheet that gets regularly updated thanks to a Zapier call. Every so often a new line is added to the sheet and i would like to check the rest of the sheet for any duplicates and remove the duplicate(s) if found. The possible duplicates will be only on some fields, for example:
- an entry is added with: Title = "My super duper night run", Distance = "3.6", Time = "24.3"
- there is already an entry with: Title = "night run", Distance = "3.6", Time = "24.3"
- there is already an entry with: Title = "My super duper night run", Distance = "5.5", Time = "45.1"
In the above scenario number 1 would be kept, number 2 would be deleted, number 3 would be kept. Note: Ideally the macro/script would run after each update but could run every so often and just scour the whole list looking for duplicates, although would need to keep the latest entry and remove the older ones.
I have some experience with VBA and have built basic Sheets scripts but not sure how to build the code to loop through the sheet (bottom up) and then remove when duplicates are found.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…