Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete duplicate rows using macro recorder duugg Excel Programming 1 February 3rd 09 05:07 PM
Trying to create Macro to delete duplicate Rows Dennis Excel Programming 2 May 8th 08 01:10 PM
macro to delete duplicate rows using Filter Lost in Alabama Excel Programming 2 March 8th 06 01:30 PM
Macro to copy duplicate rows (not delete) [email protected] Excel Programming 1 April 19th 05 12:30 PM
Macro to delete duplicate/triplicate rows Ken Wright Excel Programming 0 August 11th 03 05:50 PM


All times are GMT +1. The time now is 11:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"