Delete rows based on multiple columns


New Member
Jul 1, 2014
Hi guys,

I can't find a code that suits my needs, so I come to ask for your help.

The basic idea I want to achieve is to have unique data in my sheet, but it's a bit more complicated then a basic RemoveDuplicates. There are some if's and but's I will try to explain as clear as I can.

Col. A = shipment ID
Col. B = transport ID
Col. C = status: D, C, CD, CC, ND, NC
Col. E + F = amount
Col. H = date
Col. K = user

These are the values that have to be unique for every entry. So an entry in Col. A can exist multiple times, but only if the data in the other columns is different from another. Col. E and F have to have the same values, if that's not possible either the closest values alike or the highest value in Col. E and Col. F = 0.

I've found a code to color all duplicates and leave the first entry blank. This leaves me with a list of defined duplicates I have to remove manually. I can't remove all duplicates and leave the first entry, because that's not always the entry I want.

I've added the file to dropbox. HTML editor doesn't allow 100+ rows, which I need for my explanation. Sheet1 is the unedited data, Sheet2 has all duplicates colored in red, Sheet3 has all duplicates I want removed in red, the duplicate I want to keep in green (all white rows should ofcourse remain as is).

Could someone help me figure out this code?

/BR Janine

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Watch MrExcel Video

Forum statistics

Latest member

This Week's Hot Topics