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
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