Hello,</SPAN></SPAN>
Column D data vary; it can be 50.000 rows or can be 50 rows</SPAN></SPAN>
In the cells F5, G5 & H5 I got following formulas as per Column d data length </SPAN></SPAN>
F5 =SUM(F6:F42)</SPAN></SPAN>
G5 =SUM(F6:F42)</SPAN></SPAN>
H5 =SUM(F6:F42)</SPAN></SPAN>
My query is it possible that the formula F5, G5, H5 could be modified by VBA as per data length Column D</SPAN></SPAN>
For example if column D data last row are 20.000, so the formula in F5, G5, H5 can be changed as below by the VBA</SPAN></SPAN>
F5 =SUM(F6:F20000)</SPAN></SPAN>
G5 =SUM(F6:F20000)</SPAN></SPAN>
H5 =SUM(F6:F20000)</SPAN></SPAN>
Thank you all</SPAN></SPAN>
Excel 2000</SPAN></SPAN>
Regards,</SPAN></SPAN>
Moti</SPAN></SPAN>
Column D data vary; it can be 50.000 rows or can be 50 rows</SPAN></SPAN>
In the cells F5, G5 & H5 I got following formulas as per Column d data length </SPAN></SPAN>
F5 =SUM(F6:F42)</SPAN></SPAN>
G5 =SUM(F6:F42)</SPAN></SPAN>
H5 =SUM(F6:F42)</SPAN></SPAN>
Book1 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | ||||||||||||
2 | ||||||||||||
3 | ||||||||||||
4 | ||||||||||||
5 | 2.091 | 0 | 0 | |||||||||
6 | A | 295 | ||||||||||
7 | A | 155 | ||||||||||
8 | A | 127 | ||||||||||
9 | A | 142 | ||||||||||
10 | A | 106 | ||||||||||
11 | A | 130 | ||||||||||
12 | A | 116 | ||||||||||
13 | A | 82 | ||||||||||
14 | A | 70 | ||||||||||
15 | A | 58 | ||||||||||
16 | A | 59 | ||||||||||
17 | A | 75 | ||||||||||
18 | A | 62 | ||||||||||
19 | A | 75 | ||||||||||
20 | A | 59 | ||||||||||
21 | A | 58 | ||||||||||
22 | A | 61 | ||||||||||
23 | A | 60 | ||||||||||
24 | A | 54 | ||||||||||
25 | A | 41 | ||||||||||
26 | A | 26 | ||||||||||
27 | A | 19 | ||||||||||
28 | A | 36 | ||||||||||
29 | A | 38 | ||||||||||
30 | A | 30 | ||||||||||
31 | A | 27 | ||||||||||
32 | A | 30 | ||||||||||
33 | A | |||||||||||
34 | A | |||||||||||
35 | A | |||||||||||
36 | A | |||||||||||
37 | A | |||||||||||
38 | A | |||||||||||
39 | A | |||||||||||
40 | A | |||||||||||
41 | A | |||||||||||
42 | A | |||||||||||
43 | ||||||||||||
44 | ||||||||||||
Sheet1 |
My query is it possible that the formula F5, G5, H5 could be modified by VBA as per data length Column D</SPAN></SPAN>
For example if column D data last row are 20.000, so the formula in F5, G5, H5 can be changed as below by the VBA</SPAN></SPAN>
F5 =SUM(F6:F20000)</SPAN></SPAN>
G5 =SUM(F6:F20000)</SPAN></SPAN>
H5 =SUM(F6:F20000)</SPAN></SPAN>
Thank you all</SPAN></SPAN>
Excel 2000</SPAN></SPAN>
Regards,</SPAN></SPAN>
Moti</SPAN></SPAN>