Delete rows based on multiple columns

Amadan90

New Member
Joined
Jul 1, 2014
Messages
2
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).


https://www.dropbox.com/s/cffsh7407y54jb5/SortData.xlsm?dl=0


Could someone help me figure out this code?


/BR Janine
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Watch MrExcel Video

Forum statistics

Threads
1,129,559
Messages
5,637,056
Members
416,955
Latest member
Gohar hussain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top