madhuchelliah
Board Regular
- Joined
- Nov 22, 2017
- Messages
- 226
- Office Version
- 2019
- Platform
- Windows
Hello all, I have data in sheet1 and sheet2. Sheet1 is source data and sheet2 is input. I want to compare data in column A and B of both sheets. i.e comparing as combinations. In the example below, the VBA has to look for combinations, if it matches in both sheets then data in sheet2 B column has to be copied to sheet1 C column. If no matching combination available then it should be leave blank. Please refer the example for more clarity. THank you
Input Sheet1
Input Sheet2
Output in Sheet1
Input Sheet1
Book6 | ||||
---|---|---|---|---|
A | B | |||
1 | Reg. Number | Note | ||
2 | 2019JECAE222 | English Book | ||
3 | 2019JECAE222 | Maths Book | ||
4 | 2019JECAE222 | Physics Book | ||
5 | 2019JECAE222 | Chemistry Book | ||
6 | 2019JECAE223 | English Book | ||
7 | 2019JECAE223 | Maths Book | ||
8 | 2019JECAE223 | Chemistry Book | ||
9 | 2019JECAE224 | Maths Book | ||
10 | 2019JECAE224 | Physics Book | ||
11 | 2019JECAE224 | Chemistry Book | ||
Sheet1 |
Input Sheet2
Book6 | ||||
---|---|---|---|---|
A | B | |||
1 | Reg. Number | Note | ||
2 | 2019JECAE222 | English Book | ||
3 | 2019JECAE222 | Chemistry Book | ||
4 | 2019JECAE223 | English Book | ||
5 | 2019JECAE223 | Chemistry Book | ||
6 | 2019JECAE224 | Maths Book | ||
7 | 2019JECAE224 | Chemistry Book | ||
Sheet2 |
Output in Sheet1
Book6 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Reg. Number | Note | from sheet2 column B | ||
2 | 2019JECAE222 | English Book | English Book | ||
3 | 2019JECAE222 | Maths Book | |||
4 | 2019JECAE222 | Physics Book | |||
5 | 2019JECAE222 | Chemistry Book | Chemistry Book | ||
6 | 2019JECAE223 | English Book | English Book | ||
7 | 2019JECAE223 | Maths Book | |||
8 | 2019JECAE223 | Chemistry Book | Chemistry Book | ||
9 | 2019JECAE224 | Maths Book | Maths Book | ||
10 | 2019JECAE224 | Physics Book | |||
11 | 2019JECAE224 | Chemistry Book | Chemistry Book | ||
Sheet1 |