Excel: Code To Look At Column C And If All Data Matches In Column AC Copy To Sheet 2


I have a file as laid out below. I need the code to look at column C and if the data matches then look at column AC. If all the data in column AC says 'NYA' then copy to sheet 2 like the second example. Thanks. Excel 2010

C AC
1 CatCode StockCode
2 AAROC18 3001 NYA
3 AAROC18 3001 NYA
4 AAROC22D 3001 NYA
5 AAROC22D 3001 NYA
6 AM40004D 1001 NYA
7 AM40004D 1001 NYA
8 AM40004D 1001 NYA
9 AM50005 1001 NYA
10 AM50005 7001 TEST
11 AM50005 7001 NYA
12 AM50005D 1001 NYA
13 AM50005D 1001 NYA
14 AM50005D 5001 TEST
15 AM50005D 5001 NYA
16 AM50005D 5001 NYA
17 AM50005D 7001 NYA
18 AMCIT04D 1001 TEST
19 AMCIT04D 1001 NYA
[CENTER]Sheet1[/CENTER] As you can see below I have highlighted in yellow what needs to be copied as the data in C matches and in column AC they say NYA. Excel 2010
CAC
1CatCodeStockCode
2AAROC18 3001NYA
3AAROC18 3001NYA
4AAROC22D 3001NYA
5AAROC22D 3001NYA
6AM40004D 1001NYA
7AM40004D 1001NYA
8AM40004D 1001NYA
9AM50005 1001NYA
10AM50005 7001TEST
11AM50005 7001NYA
12AM50005D 1001NYA
13AM50005D 1001NYA
14AM50005D 5001TEST
15AM50005D 5001NYA
16AM50005D 5001NYA
17AM50005D 7001NYA
18AMCIT04D 1001TEST
19AMCIT04D 1001NYA

Sheet2




This question generated 13 answers. To proceed to the answers, click here.

This thread is current as of June 10, 2015.


For more resources for Microsoft Excel