LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default VBA to remove records

I am just starting to learn VBA and really struggling with the following
problem. Any help would be appreciated!.

I have a list of Excel records which this time round is 4 columns and 45000
records. the columns will always be the same with the same headers but the
number of records will change each time. My data looks like the following;

Item No Trans Qty Doc Number Location
4001 100 50001 EL4
4001 100 50001 EL7
4001 100 50001 EL9
4001 100 50001 EL4
4002 50 30001 3BJ
4002 50 30001 2DC
4002 50 30001 3BJ
4003 40 20001 EL4
4003 40 20001 EL7

I want to use a macro to look down the data and where the Item No, Trans Qty
and Doc Number are the same then keep the 1st record for the 1st location and
remove the other records. There may however be some instances where the Item
No, Trans Qty, Doc Number AND Location are the same e.g. Item No 4001,
Location EL4, and in these cases the records would need to be kept. I would
therefore expect to see the following result;

Item No Trans Qty Doc Number Location
4001 100 50001 EL4
4001 100 50001 EL4
4002 50 30001 3BJ
4002 50 30001 3BJ
4003 40 20001 EL4
4003 40 20001 EL7

Any ideas? Many thanks!


 
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
remove all duplicate records dberger16 Excel Discussion (Misc queries) 1 September 17th 09 06:36 PM
remove duplicate records Valori Excel Discussion (Misc queries) 1 April 23rd 07 08:04 PM
Remove blank lines between records dan Excel Discussion (Misc queries) 1 November 20th 06 09:15 PM
remove blank records (row) in worksheet sahusir Excel Discussion (Misc queries) 2 October 14th 06 05:12 PM
Check and Remove Records Madasamy Excel Discussion (Misc queries) 3 May 5th 06 01:49 PM


All times are GMT +1. The time now is 01:03 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"