LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sue Sue is offline
external usenet poster
 
Posts: 285
Default VBA Code to delete duplicate and extraneous data

I'm a novice VBA user - any assistance is appreciated.
I am using Excel 2003 and have a worksheet with about 15K rows of data. I
need VBA code that will help to delete duplicate data and extraneous data
based on specific dates or blank cells.

My worksheet looks like this:

HRID UID LName FName MI Region StartDate AdjStartDate CurrentDate TermDate
0001 lj1 Jones Lily USA 5/19/1999 5/19/1999
0002 js2 Smith Jon E Can 5/19/1999 5/19/1999
7/1/2000
0002 js2 Smith Jon E Can 5/19/1999 5/19/1999
0004 bh3 Ham Bill G USA 6/1/2000 6/1/2000 9/1/2003
9/1/2003
0005 vv5 Vish V V Ind 7/1/2003 7/1/2003 8/31/2007
8/31/2007

I am looking for VBA code that will detect the duplicates and do the
following base on dates:
If the CurrentDate and TermDate are blank ignore
If the CurrentDate is blank and the TermDate is populated delete only if
there is another row for the user where the current and term dates are blank,
else delete
If both current and termdates are populated and the dates are prior to
1/1/2007 then delete the row.
Keep all rows with delete dates after 1/1/2007

Once I have this down to only 2007 data and open dates I can begin to
calculate duration time in years and quarters.

Thank you in advance for any assistance.

 
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
How do I delete extraneous EXCEL columns? Robert Judge Excel Discussion (Misc queries) 4 February 13th 09 03:37 PM
How do I delete extraneous EXCEL columns? Robert Judge Excel Discussion (Misc queries) 2 February 12th 09 04:07 PM
Delete Every Second Duplicate Code alish Excel Discussion (Misc queries) 0 December 25th 08 08:05 PM
i want to delete duplicate items in a list using code. ndm berry[_2_] Excel Programming 2 September 27th 05 02:30 PM
How to delete extraneous rows and columns Bruce Gray Excel Discussion (Misc queries) 5 February 26th 05 05:30 PM


All times are GMT +1. The time now is 07:36 PM.

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

About Us

"It's about Microsoft Excel"