Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Len Len is offline
external usenet poster
 
Posts: 162
Default Remove Duplicates

Hi,

I need excel vba codes to remove duplicates based on example below : -

Duplicates Tran Date Doc Ref No.Tran Amt. Tran Type
8920331 9/12/2010 892033 60.00 1
8920331 14/12/2010 892033 60.00 1
8923992 1/12/2010 892399 (19,970.00) 2
8920332 10/12/2010 892033 (60.00) 2
8923991 212/2010 892399 19,970.00 1
8923992 3/12/2010 892399 (19,970.00) 2

1st case = Say duplicate is 892033 in column C
If 8920331 & 8920332 ( ie helper column where Duplicate & Tran Type)
are found in column "A " then
Remove that rows

2nd case = Say duplicate is 892399 in column C
If 8923391 & 8923392 are found in column "A " then
Remove that rows

May be they are more cases of duplicates in column A and will be
remove that rows accordingly until there are no duplicates

The final result will be : -

Duplicates Tran Date Doc Ref No.Tran Amt. Tran Type
8920331 9/12/2010 892033 60.00 1
8923992 3/12/2010 892399 (19,970.00) 2


Any helps will be appreciated and thanks in advance

Regards
Len

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Remove Duplicates

On Feb 21, 2:04*am, Len wrote:
Hi,

I need excel vba codes to remove duplicates based on example below : -

Duplicates * * *Tran Date * * * Doc Ref No.Tran Amt. Tran Type
8920331 9/12/2010 * * * 892033 * * *60.00 * * * * 1
8920331 14/12/2010 892033 * * * * *60.00 * * * * *1
8923992 1/12/2010 * * * 892399 * (19,970.00) 2
8920332 10/12/2010 892033 * * * *(60.00) * * * * *2
8923991 212/2010 * * * *892399 * 19,970.00 * 1
8923992 3/12/2010 * * * 892399 * (19,970.00) *2

1st case = Say duplicate is 892033 in column C
If 8920331 & 8920332 ( ie helper column where Duplicate & Tran Type)
are found in column "A " then
Remove that rows

2nd case = Say duplicate is 892399 in column C
If 8923391 & 8923392 are found in column "A " then
Remove that rows

May be they are more cases of duplicates in column A and will be
remove that rows accordingly until there are no duplicates

The final result will be : -

Duplicates * * *Tran Date * * * Doc Ref No.Tran Amt. Tran Type
8920331 9/12/2010 * * * 892033 * 60.00 * * * 1
8923992 3/12/2010 * * * 892399 * (19,970.00) * *2

Any helps will be appreciated and thanks in advance

Regards
Len


You might want to check out Chip Pearsons 'Unique Finder' code:
http://www.cpearson.com/excel/GetDistinct.aspx
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Remove Duplicates

If using xl 2007 use remove duplicate feature
select the entire range
click Data tab
in Data Tools group 2nd command is remove duplicate.Click it


  #4   Report Post  
Posted to microsoft.public.excel.programming
Len Len is offline
external usenet poster
 
Posts: 162
Default Remove Duplicates

Hi Javed,

Thanks for your reply

After working around and using xl 2007 Remove Duplicates and Data
Group, it seems that it can not apply in my example as there are 3
conditional criterias need to be fulfilled ( ie 1st condition where
Duplicates exist in column C, 2nd condition where Duplicate & Tran
Type must be matched & found in column A and 3rd condition where Trans
Amt in column D of that 2nd condition has to be zerolised )

Perhaps, there might be better idea advise from you


Regards
Len

  #5   Report Post  
Posted to microsoft.public.excel.programming
Len Len is offline
external usenet poster
 
Posts: 162
Default Remove Duplicates

Hi,

Can anyone help on this scenario ?

Thanks

Cheers
Len


  #6   Report Post  
Posted to microsoft.public.excel.programming
Len Len is offline
external usenet poster
 
Posts: 162
Default Remove Duplicates

Hi Greg,

Thanks for your advice and thanks to cpearson codes
However, it looks complicated to apply to my example as I'm excel vba
learner

It would be great if you could modify the codes or develop new codes
for my example

In my above example, one more condition to be fulfilled before
removing that rows, Trans Amt for 1st case duplicate where 8920331 &
8920332 found in column A, has to be zerolised ( ie 60 - 60 = 0 ) and
likewise for 2nd case duplicate ( ie 19,970 - 19,970=0 )

Sorry for any inconvenience cause

Thanks & Regards
Len

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
How do I remove duplicates Gazza Excel Discussion (Misc queries) 7 January 29th 10 04:33 PM
remove duplicates need help faceliftguide Setting up and Configuration of Excel 3 July 14th 09 02:27 PM
Remove Duplicates Joe Excel Worksheet Functions 2 February 13th 09 11:58 PM
Remove Duplicates dk New Users to Excel 15 March 28th 08 07:41 AM
Remove duplicates Tuttamay77 Excel Discussion (Misc queries) 4 May 12th 06 10:56 PM


All times are GMT +1. The time now is 12:11 AM.

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"