Dynamic Range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
If I understand you correctly:

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

JE McGimpsey said:
If I understand you correctly:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top