Colouring the rows if some conditions are meeting

Closed
pamla2015
Posts
1
Registration date
Thursday January 22, 2015
Status
Member
Last seen
January 22, 2015
- Jan 22, 2015 at 04:38 AM
I am trying to create a macro of some sort to do some checks to make sure everything is populated correctly. Here is an example of the spreadsheet...

A B C D
1 Kit Item1 Item2 Item3
2 AAA ABC BCD PURCHASE
3 AAA ABC BCD PUR
4 BBB BCD CDE SAL
5 BBB ABC CDE SALE
6 BBB ABC CDE SAL


I need to write a macro that will do the following.
If cell A2 = A3 then check if B2 = B3 & C2 = C3 & (D2=PURCHASE & D3=PUR or D2=SALE & D3=SAL).
If all match then color both the rows
But if any of the criteria doesn't match then step down to A3 vs A4

In the example above A2 = A3 and B2 = B3 & C2 = C3 & D2 = D3, so both the rows will be colored.
In the example above A4 = A5 and B4 <> B5 & C4 = C5 & D4 <> D5, so step down to A5 vs A6
Also note that there are 100s of matching pairs in column D

Please help me in preparing this macro in Excel 2010