macro to delete rows below the first row with duplicate data

T

tkmaster3

I am looking for a macro to delete rows of data that are below the row I want
to keep. I have a table that pulls in scan codes from specific work order
#'s. The problem I have is that I only need to have the last scan that was
entered for that work order #, and not every scan that was done previously to
that work order #.

WO NUMBER DC TRAN DATE DC TRAN TIME
0436686 10/14/2009 0:00 1292
0436686 10/14/2009 0:00 1008
0436686 10/14/2009 0:00 979
0436686 10/14/2009 0:00 976
0436686 10/14/2009 0:00 974
0436686 10/13/2009 0:00 1597
0436686 10/13/2009 0:00 1582
0436663 10/14/2009 0:00 1275
0436663 10/14/2009 0:00 1044
0436663 10/14/2009 0:00 1008
0436659 10/13/2009 0:00 1455
0436659 10/13/2009 0:00 1448
0436659 10/13/2009 0:00 1448
0436655 10/14/2009 0:00 1380
0436655 10/13/2009 0:00 1375
0436552 10/13/2009 0:00 1560
0436552 10/13/2009 0:00 1386
0436551 10/13/2009 0:00 1560
0436551 10/13/2009 0:00 1386
0436549 10/13/2009 0:00 1561
0436549 10/13/2009 0:00 1386

The Advanced Filter of the Data tab works perfect when I select the WORK
ORDER column and select Unique records only. The problem is that they are
only hidden and the data is still there. I want to reduce the file size by
eliminating the un needed data.

Basically a macro that would only keep the first row of the duplicated work
order# is all I want to keep, and the others deleted.

Thank you,
 
T

tkmaster3

I should add I am using Excel 2003

I want the data to look like this when the macro is done:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top