I have account Numbers in Col A and in Col C. I need to compare these and extract into Col G , those that are unique to both Columns
I have tried to write code to compare the account numbers in Col A & C and extract those that are unique to both in Col G, but the code only copies the exact data that appears in Col A & C and not those that are unique to both these columns
When the unique records are extracted in Col G, I would also like the Col Number where the record was extracted to display in Col H
It would be appreciated if someone could kindly amend my code
See Sample Data of what the unique records should look like once extracted
I have tried to write code to compare the account numbers in Col A & C and extract those that are unique to both in Col G, but the code only copies the exact data that appears in Col A & C and not those that are unique to both these columns
When the unique records are extracted in Col G, I would also like the Col Number where the record was extracted to display in Col H
It would be appreciated if someone could kindly amend my code
Code:
Sub Extract_Unique_ITEMS()
Sheets(14).Select
Range("A2:C" & Range("A" & Rows.Count).End(xlUp).Row).AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=Range("G2"), Unique:=True
End Sub
See Sample Data of what the unique records should look like once extracted
Excel 2012 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | Mapping Data | Input Data | ||||||||
2 | KNR-3004 | KNR-3024 | KNR-3004 | Col A | ||||||
3 | KNR-3024 | KNR-3025 | KNR-3026 | Col A | ||||||
4 | KNR-3025 | KNR-3064 | KNR-3027 | Col A | ||||||
5 | KNR-3026 | KNR-3065 | KNR-3029 | Col A | ||||||
6 | KNR-3027 | KNR-3066 | KNR-3067 | Col A | ||||||
7 | KNR-3029 | KNR-3304 | KNR-3304 | Col B | ||||||
8 | KNR-3064 | KNR-3305 | KNR-3305 | Col B | ||||||
9 | KNR-3065 | KNR-3306 | KNR-3306 | Col B | ||||||
10 | KNR-3066 | KNR-3514 | KNR-3514 | Col B | ||||||
11 | KNR-3067 | KNR-3524 | KNR-3524 | Col B | ||||||
12 | ||||||||||
13 | ||||||||||
14 | ||||||||||
15 | ||||||||||
Sheet1 |
Last edited: