Identifying Duplicates

  • Thread starter Thread starter Nigel
  • Start date Start date
N

Nigel

Hi All
In a VBA procedure I have 5 integer numbers held in 5 different variables,
n1 to n5. I want to identify if any combination of these values are
duplicated and to highlight which ones.

So if the values are
1,2,3,4,5 - No duplicates All Ok
1,1,3,4,5 - Two duplicates - positions1 and 2
1,1,3,1,5 - Three duplicates - positions 1, 2 and 4
1,1,3,4,4 - Four duplicates - postions 1,2,4 and 5
1,1,1,1,1 - Five Duplicates - positions 1,2,3,4 and 5

I guess I need to loop through each variable testing each other variable for
match or not and log any errors and positions.

Any ideas on the best approach

Cheers
TIA
Nigel
 
Check out this page.
http://www.cpearson.com/excel/duplicat.htm#HighlightingDuplicates
HTH

Nigel said:
Hi All
In a VBA procedure I have 5 integer numbers held in 5 different variables,
n1 to n5. I want to identify if any combination of these values are
duplicated and to highlight which ones.

So if the values are
1,2,3,4,5 - No duplicates All Ok
1,1,3,4,5 - Two duplicates - positions1 and 2
1,1,3,1,5 - Three duplicates - positions 1, 2 and 4
1,1,3,4,4 - Four duplicates - postions 1,2,4 and 5
1,1,1,1,1 - Five Duplicates - positions 1,2,3,4 and 5

I guess I need to loop through each variable testing each other variable for
match or not and log any errors and positions.

Any ideas on the best approach

Cheers
TIA
Nigel





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
Back
Top