I’m just starting with VBA, but after spending a day looking at remove duplicates/values VBA tutorials I still cannot come up with a way to do this task.
I need to remove duplicates from a list based on several criteria.
First, identify duplicate record numbers (column A). Then delete the entire row of the duplicate(s) (there may be several instances of the same duplicate) except were the values at column S are different AND both (all) values belong to a predefined set, OR the values at column X are different (and the value of the duplicate is any value).
If the value of the duplicate is from set 1, and the value of its counterpart(s) is not from set 1, it is the latter that has to be deleted.
Not trying to delete both (all) duplicates! 1 value should remain.
Where the Location value is a town in England (London, Leeds), duplicates should be kept. Where the value in the Cost column is different, duplicates should be kept. If one of the duplicates has a Location value that is a town in England (London, Leeds), and the others do not, the others are the ones to be deleted.
A S X
No Location Cost
2 Glasgow 200
2 London 200
2 Leeds 200
2 Glasgow 100
returns
A S X
No Location Cost
2 London 200
2 Leeds 200
2 Glasgow 100
Thanks in advance for any suggestions!