I have two sheets contain data with same structure. so what I want matching items for columns B,C,D together for two sheets DATA,INPUT if they are matched then should put the values under empty columns contain headers names PU,SA into sheet INPUT from the sheet DATA , if I run macro again , then should move to next empty columns contain headers names PU,SA after three filled columns PU,SA,BL and so on every time run the macro should search for the headers PU,SA are empty cells ,then should fill based on match column B,C,D together . the aim for this every week changes the values and increase or changes data in sheet DATA and I have to add the values into new columns PU,SA.
result for two condition as example
thanks
Microsoft Excel (6).xlsx | ||||||||
---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | |||
1 | DESCRIBE | Q1 | ||||||
2 | GOODS | TYPE | PR | PU | SA | BL | ||
3 | CCR-1 | BMW | 2010 | 380 | 200 | 180 | ||
4 | CCR-1 | BMW | 2011 | 120 | 40 | 80 | ||
5 | CCR-2 | TIGUAN | 2012 | 120 | 0 | 120 | ||
6 | CCB-1 | AUDI | 2011 | 80 | 10 | 70 | ||
7 | CCB-2 | OPEL | 2008 | 100 | 10 | 90 | ||
8 | CCB-3 | MER | 2009 | 120 | 10 | 110 | ||
9 | CCB-3 | MER | 2010 | 101 | 101 | |||
data |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G3:G9 | G3 | =E3-F3 |
Microsoft Excel (6).xlsx | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | K | L | M | |||
1 | DESCRIBE | Q1 | Q2 | Q3 | ||||||||||
2 | GOODS | TYPE | PR | PU | SA | BL | PU | SA | BL | PU | SA | BL | ||
3 | CCR-1 | BMW | 2010 | 0 | 0 | 0 | ||||||||
4 | CCR-1 | BMW | 2011 | 0 | 0 | 0 | ||||||||
5 | CCR-2 | TIGUAN | 2012 | 0 | 0 | 0 | ||||||||
6 | CCB-1 | AUDI | 2011 | 0 | 0 | 0 | ||||||||
7 | CCB-2 | OPEL | 2008 | 0 | 0 | 0 | ||||||||
8 | CCB-3 | MER | 2009 | 0 | 0 | 0 | ||||||||
9 | ||||||||||||||
input |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G3:G8 | G3 | =E3-F3 |
M3:M8,J3:J8 | J3 | =G3+H3-I3 |
result for two condition as example
Microsoft Excel (6).xlsx | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | K | L | M | |||
1 | DESCRIBE | Q1 | Q2 | Q3 | ||||||||||
2 | GOODS | TYPE | PR | PU | SA | BL | PU | SA | BL | PU | SA | BL | ||
3 | CCR-1 | BMW | 2010 | 380 | 200 | 180 | 180 | 180 | ||||||
4 | CCR-1 | BMW | 2011 | 120 | 40 | 80 | 80 | 80 | ||||||
5 | CCR-2 | TIGUAN | 2012 | 120 | 0 | 120 | 120 | 120 | ||||||
6 | CCB-1 | AUDI | 2011 | 80 | 10 | 70 | 70 | 70 | ||||||
7 | CCB-2 | OPEL | 2008 | 100 | 10 | 90 | 90 | 90 | ||||||
8 | CCB-3 | MER | 2009 | 120 | 10 | 110 | 110 | 110 | ||||||
9 | ||||||||||||||
input |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G3:G8 | G3 | =E3-F3 |
M3:M8,J3:J8 | J3 | =G3+H3-I3 |
ورقة عمل Microsoft Excel جديد (6).xlsx | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | K | L | M | |||
1 | DESCRIBE | Q1 | Q2 | Q3 | ||||||||||
2 | GOODS | TYPE | PR | PU | SA | BL | PU | SA | BL | PU | SA | BL | ||
3 | CCR-1 | BMW | 2010 | 380 | 200 | 180 | 380 | 200 | 360 | 360 | ||||
4 | CCR-1 | BMW | 2011 | 120 | 40 | 80 | 120 | 40 | 160 | 160 | ||||
5 | CCR-2 | TIGUAN | 2012 | 120 | 0 | 120 | 120 | 0 | 240 | 240 | ||||
6 | CCB-1 | AUDI | 2011 | 80 | 10 | 70 | 80 | 10 | 140 | 140 | ||||
7 | CCB-2 | OPEL | 2008 | 100 | 10 | 90 | 100 | 10 | 180 | 180 | ||||
8 | CCB-3 | MER | 2009 | 120 | 10 | 110 | 120 | 10 | 220 | 220 | ||||
input |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G3:G8 | G3 | =E3-F3 |
M3:M8,J3:J8 | J3 | =G3+H3-I3 |
thanks