Hi, Can someone help mw with a VBA code for the below.
below is my input list
and this is my output list.
this is my expected output.
code has to compare column A data from both sheets and if anything new is found then that needs to be added above the grand total in column A (In this case it is name D)
then it has to compare combnation of colum A and Column B and if any combination is not present then that needs to added below the last occurance of respective name1 row.(In this case we have B-1 which is not present in the output and has been added to 11th row as 10th row is last occurnce of B. similarly D-7 has been added to 16th row.).
thank you in advance.
below is my input list
Book3 | ||||
---|---|---|---|---|
A | B | |||
1 | Name1 | Name2 | ||
2 | A | |||
3 | A | 1 | ||
4 | A | 2 | ||
5 | A | 3 | ||
6 | A | 4 | ||
7 | B | |||
8 | B | 1 | ||
9 | B | 3 | ||
10 | B | 2 | ||
11 | B | 4 | ||
12 | C | |||
13 | C | 5 | ||
14 | C | 6 | ||
15 | D | |||
16 | D | 7 | ||
17 | Grandtotal | |||
Sheet2 |
and this is my output list.
Book3 | ||||
---|---|---|---|---|
A | B | |||
1 | Name1 | Name2 | ||
2 | A | |||
3 | A | 1 | ||
4 | A | 2 | ||
5 | A | 3 | ||
6 | A | 4 | ||
7 | B | |||
8 | B | 3 | ||
9 | B | 2 | ||
10 | B | 4 | ||
11 | C | |||
12 | C | 5 | ||
13 | C | 6 | ||
14 | Grandtotal | |||
Sheet1 |
this is my expected output.
Book3 | ||||
---|---|---|---|---|
A | B | |||
1 | Name1 | Name2 | ||
2 | A | |||
3 | A | 1 | ||
4 | A | 2 | ||
5 | A | 3 | ||
6 | A | 4 | ||
7 | B | |||
8 | B | 3 | ||
9 | B | 2 | ||
10 | B | 4 | ||
11 | B | 1 | ||
12 | C | |||
13 | C | 5 | ||
14 | C | 6 | ||
15 | D | |||
16 | D | 7 | ||
17 | Grandtotal | |||
Sheet2 |
code has to compare column A data from both sheets and if anything new is found then that needs to be added above the grand total in column A (In this case it is name D)
then it has to compare combnation of colum A and Column B and if any combination is not present then that needs to added below the last occurance of respective name1 row.(In this case we have B-1 which is not present in the output and has been added to 11th row as 10th row is last occurnce of B. similarly D-7 has been added to 16th row.).
thank you in advance.