ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dynamic Range (https://www.excelbanter.com/excel-programming/314284-dynamic-range.html)

Gian

Dynamic Range
 
I would like to sum up some values within the cells for each loop,like A1..A5
when i = 1, B2..B6 when i=2 etc., I know I can not put the cell variable into
the Range() property. Are there any other way to do this? Please help.

JE McGimpsey

Dynamic Range
 
If I understand you correctly:

For i = 1 to n
mySum = Application.Sum(Cells(i, i).Resize(5, 1))
'other stuff
Next i

In article ,
"Gian" wrote:

I would like to sum up some values within the cells for each loop,like A1..A5
when i = 1, B2..B6 when i=2 etc., I know I can not put the cell variable into
the Range() property. Are there any other way to do this? Please help.


Gian

Dynamic Range
 
Thanks JE.

"JE McGimpsey" wrote:

If I understand you correctly:

For i = 1 to n
mySum = Application.Sum(Cells(i, i).Resize(5, 1))
'other stuff
Next i

In article ,
"Gian" wrote:

I would like to sum up some values within the cells for each loop,like A1..A5
when i = 1, B2..B6 when i=2 etc., I know I can not put the cell variable into
the Range() property. Are there any other way to do this? Please help.




All times are GMT +1. The time now is 05:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com