Remove Duplicate based on Time

cothraw1

New Member
Joined
Jan 11, 2008
Messages
11
I have a spreadsheet with 3 columns: Usercode, Date Accessed and Time Accessed. The major sort is Usercode and then a minor sort by Date Accessed and then Time Accessed. I need a macro that will remove all of the duplicate Date Accessed for each unique Usercode and the remaining Date Accessed should be the one with the earliest Time Accessed for that particular day. It would do this for each unique Usercode so each Usercode may have the same values for Date Accessed but for each unique Usercode there would only be unique values for Date Accessed which would be the one with the earliest Time Accessed for that particular day . For instance, in my example below, I would need the macro to remove Rows A, D, F, H and I. If it helps, the original format for Date Accessed is 1/8/2018 9:47:33 AM in one cell but then I just used a formula to split the two to read 1/8/2018 and 9:47 AM into two separate cells. Any help would be much appreciated.

Row Usercode Date Accessed Time Accessed
A AB 1/8/2018 9:47 AM
B AB 1/8/2018 9:21 AM
C AB 1/4/2018 11:05 AM
D AB 1/3/2018 11:14 AM
E AB 1/3/2018 11:00 AM
F CD 1/8/2018 1:33 PM
G CD 1/8/2018 9:11 AM
H CD 1/5/2018 4:16 PM
I CD 1/5/2018 2:03 PM
J CD 1/5/2018 9:04 AM
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

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
Back
Top