Highlight Duplicates from Two Columns with Different Colours

gacicd

New Member
Joined
Nov 30, 2012
Messages
30

I have two columns A1 (Section X) and B1 (Section Y) <o:p></o:p>

Each column has 20 rows of data (A2-B21) such as: <o:p></o:p>

Section X

Section Y

1<o:p></o:p>

33<o:p></o:p>

2<o:p></o:p>

34<o:p></o:p>

3<o:p></o:p>

35<o:p></o:p>

4<o:p></o:p>

36<o:p></o:p>

5<o:p></o:p>

37<o:p></o:p>

3<o:p></o:p>

35<o:p></o:p>

7<o:p></o:p>

39<o:p></o:p>

8<o:p></o:p>

40<o:p></o:p>

9<o:p></o:p>

41<o:p></o:p>

10<o:p></o:p>

42<o:p></o:p>

11<o:p></o:p>

43<o:p></o:p>

12<o:p></o:p>

44<o:p></o:p>

10<o:p></o:p>

42<o:p></o:p>

14<o:p></o:p>

46<o:p></o:p>

10<o:p></o:p>

42<o:p></o:p>

16<o:p></o:p>

48<o:p></o:p>

17<o:p></o:p>

49<o:p></o:p>

18<o:p></o:p>

50<o:p></o:p>

19<o:p></o:p>

51<o:p></o:p>

20<o:p></o:p>

52<o:p></o:p>

<tbody>
</tbody>
<o:p> </o:p>
What I need is either dynamic formula or macros that can do thefollowing:

1) Assess range A2-B21; <o:p></o:p>
<o:p> </o:p>
2) Identify sets of duplicates based on the identicalvalues in both columns - for example in this case there are two sets of duplicates:<o:p></o:p>
<o:p> </o:p>
-Set 1: A4 (4)/B4(36) isidentical with A7/(4)B7(36); and <o:p></o:p>
<o:p> </o:p>
-Set 2: A11(10)/B11(42) isidentical with: A14(10/B14(42) is identical with A16(10)|B16 (42)
<o:p> </o:p>
3) Highlight cells that contain sets of duplicates withdifferent colours – for example:<o:p></o:p>
<o:p> </o:p>
Cell colour for Set1 (A4 /B4 & A7/B7) should be different to cell colour for Set 2 (A11/B11, A14/B14 & A16|B16). <o:p></o:p>
<o:p> </o:p>
This colouring should be dynamic – data in this table is updated on adaily basis so as the number of duplicates will vary all the time. <o:p></o:p>
<o:p> </o:p>
Thanks in advance <o:p></o:p>
<o:p> </o:p>
<o:p></o:p>

 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi,
I tried this VBA code and it works perfectly fine, but it seems that colorindex function is limited to certain number of rows. If I try to set Range as below, error is popping up: "Out of the range". Do you know how could I replace the colorindex function or what should I do to make it work? Thanks a lot.

Set DupeRange = Range("D7:E500") '<- Set this as desired</pre>
 
Upvote 0

Forum statistics

Threads
1,221,558
Messages
6,160,486
Members
451,651
Latest member
Penapensil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top