ziad alsayed
Well-known Member
- Joined
- Jul 17, 2010
- Messages
- 665
dear all
i have 3 Sheets the first is named "PHC 2011", the Second is named "Apapa 2011", the third is named "nigeria", the third Sheet get the Information from the first 2 sheets and Some them.
what i need is a VBA code that Work base on the cell "A1" in the "Nigeria" Sheet. the "A1" cell is a drop down list for month. so base on the "A1" the Code has to sum the data from the 2 Sheets "PHC 2011" and "Apapa 2011"
Appreciate Any Help
below is a Sample for the 3 Sheets
Excel 2010
Excel 2010
Excel 2010
i have 3 Sheets the first is named "PHC 2011", the Second is named "Apapa 2011", the third is named "nigeria", the third Sheet get the Information from the first 2 sheets and Some them.
what i need is a VBA code that Work base on the cell "A1" in the "Nigeria" Sheet. the "A1" cell is a drop down list for month. so base on the "A1" the Code has to sum the data from the 2 Sheets "PHC 2011" and "Apapa 2011"
Appreciate Any Help
below is a Sample for the 3 Sheets
Excel Workbook | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | |||
1 | |||||||||||||
2 | PHC 2011 | ||||||||||||
3 | SIZE | Jan/11 | Feb/11 | Mar/11 | |||||||||
4 | Range | Model | MTN | MC | Total | MTN | MC | Total | MTN | MC | Total | ||
5 | L12.5 | LPW3 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
6 | L17.5 | LPW4 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
7 | L17.5DS | LPW4 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
8 | L17.5LR | LPW4 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
9 | P13.5E2 | 403C-15G | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
10 | P18E2 | 404C-22G1 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
11 | P22E2 | 404C-22G2 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
12 | P27 | 3.1524 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
13 | P27P1 | 1103A-33G1 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
14 | P40P1 | 1004G | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
15 | P40P3 | 1103A-33TG1 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
16 | P60P1 | 1004TG | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
17 | P60P3 | 1103A-33TG2 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
18 | P75 | 1004TG | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
19 | P80 | 1104-44TG2 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
20 | P100P1 | 1104-44TAG | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
21 | P110E | 1006TG2A | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
22 | P150E | 1006TAG | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
23 | P150P1 | 1006TAG1 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
24 | P160H | 1306-E87TA215 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
25 | P180 | 1106 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
26 | P200H | 1306-E87TA300 | 39 | 45 | 84 | 40 | 40 | 80 | 41 | 41 | 82 | ||
27 | Total | 858 | 990 | 1848 | 880 | 880 | 1760 | 902 | 902 | 1804 | |||
PHC 2011 |
Excel Workbook | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | |||
1 | |||||||||||||
2 | Apapa 2011 | ||||||||||||
3 | SIZE | Jan/11 | Feb/11 | Mar/11 | |||||||||
4 | Range | Model | MTN | MC | Total | MTN | MC | Total | MTN | MC | Total | ||
5 | L12.5 | LPW3 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
6 | L17.5 | LPW4 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
7 | L17.5DS | LPW4 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
8 | L17.5LR | LPW4 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
9 | P13.5E2 | 403C-15G | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
10 | P18E2 | 404C-22G1 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
11 | P22E2 | 404C-22G2 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
12 | P27 | 3.1524 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
13 | P27P1 | 1103A-33G1 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
14 | P40P1 | 1004G | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
15 | P40P3 | 1103A-33TG1 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
16 | P60P1 | 1004TG | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
17 | P60P3 | 1103A-33TG2 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
18 | P75 | 1004TG | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
19 | P80 | 1104-44TG2 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
20 | P100P1 | 1104-44TAG | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
21 | P110E | 1006TG2A | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
22 | P150E | 1006TAG | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
23 | P150P1 | 1006TAG1 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
24 | P160H | 1306-E87TA215 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
25 | P180 | 1106 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
26 | P200H | 1306-E87TA300 | 2 | 10 | 12 | 3 | 3 | 6 | 4 | 4 | 8 | ||
27 | Total | 44 | 220 | 264 | 66 | 66 | 132 | 88 | 88 | 176 | |||
Apapa 2011 |
Excel Workbook | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Jan/11 | ||||||
2 | NIGERIA | GENSETS | |||||
3 | SIZE | Nb. Of Gensets | |||||
4 | Range | Model | MTN | MC | Total | ||
5 | L12.5 | LPW3 | 41 | 55 | 96 | ||
6 | L17.5 | LPW4 | 41 | 55 | 96 | ||
7 | L17.5DS | LPW4 | 41 | 55 | 96 | ||
8 | L17.5LR | LPW4 | 41 | 55 | 96 | ||
9 | P13.5E2 | 403C-15G | 41 | 55 | 96 | ||
10 | P18E2 | 404C-22G1 | 41 | 55 | 96 | ||
11 | P22E2 | 404C-22G2 | 41 | 55 | 96 | ||
12 | P27 | 3.1524 | 41 | 55 | 96 | ||
13 | P27P1 | 1103A-33G1 | 41 | 55 | 96 | ||
14 | P40P1 | 1004G | 41 | 55 | 96 | ||
15 | P40P3 | 1103A-33TG1 | 41 | 55 | 96 | ||
16 | P60P1 | 1004TG | 41 | 55 | 96 | ||
17 | P60P3 | 1103A-33TG2 | 41 | 55 | 96 | ||
18 | P75 | 1004TG | 41 | 55 | 96 | ||
19 | P80 | 1104-44TG2 | 41 | 55 | 96 | ||
20 | P100P1 | 1104-44TAG | 41 | 55 | 96 | ||
21 | P110E | 1006TG2A | 41 | 55 | 96 | ||
22 | P150E | 1006TAG | 41 | 55 | 96 | ||
23 | P150P1 | 1006TAG1 | 41 | 55 | 96 | ||
24 | P160H | 1306-E87TA215 | 41 | 55 | 96 | ||
25 | P180 | 1106C-E66TAG4 | 41 | 55 | 96 | ||
26 | P200H | 1306-E87TA300 | 41 | 55 | 96 | ||
27 | Total | 902 | 1210 | 2112 | |||
Nigeria |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A5 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A5 | |
A6 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A6 | |
A9 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A9 | |
A10 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A10 | |
A11 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A11 | |
A12 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A12 | |
A13 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A13 | |
A14 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A14 | |
A15 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A15 | |
A16 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A16 | |
A17 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A17 | |
A18 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A18 | |
A19 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A19 | |
A20 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A20 | |
A21 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A21 | |
A22 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A22 | |
A23 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A23 | |
A24 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A24 | |
A26 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A26 | |
B5 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B5 | |
B6 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B6 | |
B9 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B9 | |
B10 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B10 | |
B11 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B11 | |
B12 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B12 | |
B13 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B13 | |
B14 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B14 | |
B15 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B15 | |
B16 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B16 | |
B17 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B17 | |
B18 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B18 | |
B19 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B19 | |
B20 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B20 | |
B21 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B21 | |
B22 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B22 | |
B23 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B23 | |
B24 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B24 | |
B26 | ='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B26 | |
C5 | ='PHC 2011'!C5+'Apapa 2011'!C5 | |
C6 | ='PHC 2011'!C6+'Apapa 2011'!C6 | |
C7 | ='PHC 2011'!C7+'Apapa 2011'!C7 | |
C8 | ='PHC 2011'!C8+'Apapa 2011'!C8 | |
C9 | ='PHC 2011'!C9+'Apapa 2011'!C9 | |
C10 | ='PHC 2011'!C10+'Apapa 2011'!C10 | |
C11 | ='PHC 2011'!C11+'Apapa 2011'!C11 | |
C12 | ='PHC 2011'!C12+'Apapa 2011'!C12 | |
C13 | ='PHC 2011'!C13+'Apapa 2011'!C13 | |
C14 | ='PHC 2011'!C14+'Apapa 2011'!C14 | |
C15 | ='PHC 2011'!C15+'Apapa 2011'!C15 | |
C16 | ='PHC 2011'!C16+'Apapa 2011'!C16 | |
C17 | ='PHC 2011'!C17+'Apapa 2011'!C17 | |
C18 | ='PHC 2011'!C18+'Apapa 2011'!C18 | |
C19 | ='PHC 2011'!C19+'Apapa 2011'!C19 | |
C20 | ='PHC 2011'!C20+'Apapa 2011'!C20 | |
C21 | ='PHC 2011'!C21+'Apapa 2011'!C21 | |
C22 | ='PHC 2011'!C22+'Apapa 2011'!C22 | |
C23 | ='PHC 2011'!C23+'Apapa 2011'!C23 | |
C24 | ='PHC 2011'!C24+'Apapa 2011'!C24 | |
C25 | ='PHC 2011'!C25+'Apapa 2011'!C25 | |
C26 | ='PHC 2011'!C26+'Apapa 2011'!C26 | |
C27 | =SUM(C5:C26) | |
D5 | ='PHC 2011'!D5+'Apapa 2011'!D5 | |
D6 | ='PHC 2011'!D6+'Apapa 2011'!D6 | |
D7 | ='PHC 2011'!D7+'Apapa 2011'!D7 | |
D8 | ='PHC 2011'!D8+'Apapa 2011'!D8 | |
D9 | ='PHC 2011'!D9+'Apapa 2011'!D9 | |
D10 | ='PHC 2011'!D10+'Apapa 2011'!D10 | |
D11 | ='PHC 2011'!D11+'Apapa 2011'!D11 | |
D12 | ='PHC 2011'!D12+'Apapa 2011'!D12 | |
D13 | ='PHC 2011'!D13+'Apapa 2011'!D13 | |
D14 | ='PHC 2011'!D14+'Apapa 2011'!D14 | |
D15 | ='PHC 2011'!D15+'Apapa 2011'!D15 | |
D16 | ='PHC 2011'!D16+'Apapa 2011'!D16 | |
D17 | ='PHC 2011'!D17+'Apapa 2011'!D17 | |
D18 | ='PHC 2011'!D18+'Apapa 2011'!D18 | |
D19 | ='PHC 2011'!D19+'Apapa 2011'!D19 | |
D20 | ='PHC 2011'!D20+'Apapa 2011'!D20 | |
D21 | ='PHC 2011'!D21+'Apapa 2011'!D21 | |
D22 | ='PHC 2011'!D22+'Apapa 2011'!D22 | |
D23 | ='PHC 2011'!D23+'Apapa 2011'!D23 | |
D24 | ='PHC 2011'!D24+'Apapa 2011'!D24 | |
D25 | ='PHC 2011'!D25+'Apapa 2011'!D25 | |
D26 | ='PHC 2011'!D26+'Apapa 2011'!D26 | |
D27 | =SUM(D5:D26) | |
E5 | =SUM(C5:D5) | |
E6 | =SUM(C6:D6) | |
E7 | =SUM(C7:D7) | |
E8 | =SUM(C8:D8) | |
E9 | =SUM(C9:D9) | |
E10 | =SUM(C10:D10) | |
E11 | =SUM(C11:D11) | |
E12 | =SUM(C12:D12) | |
E13 | =SUM(C13:D13) | |
E14 | =SUM(C14:D14) | |
E15 | =SUM(C15:D15) | |
E16 | =SUM(C16:D16) | |
E17 | =SUM(C17:D17) | |
E18 | =SUM(C18:D18) | |
E19 | =SUM(C19:D19) | |
E20 | =SUM(C20:D20) | |
E21 | =SUM(C21:D21) | |
E22 | =SUM(C22:D22) | |
E23 | =SUM(C23:D23) | |
E24 | =SUM(C24:D24) | |
E25 | =SUM(C25:D25) | |
E26 | =SUM(C26:D26) | |
E27 | =SUM(C27:D27) |