Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro to delete rows below the first row with duplicate data
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, -- ~TK~ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro to delete rows below the first row with duplicate data
I should add I am using Excel 2003
I want the data to look like this when the macro is done: WO NUMBER DC TRAN DATE DC TRAN TIME 0436686 10/14/2009 0:00 1292 0436663 10/14/2009 0:00 1275 0436659 10/13/2009 0:00 1455 0436655 10/14/2009 0:00 1380 0436552 10/13/2009 0:00 1560 0436551 10/13/2009 0:00 1560 0436549 10/13/2009 0:00 1561 -- ~TK~ "tkmaster3" wrote: 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, -- ~TK~ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete duplicate rows using macro recorder | Excel Programming | |||
Trying to create Macro to delete duplicate Rows | Excel Programming | |||
macro to delete duplicate rows using Filter | Excel Programming | |||
Macro to copy duplicate rows (not delete) | Excel Programming | |||
Macro to delete duplicate/triplicate rows | Excel Programming |