calculate sum of range

  • Thread starter Thread starter Paulg
  • Start date Start date
P

Paulg

I posted previoulsy that I needed to select the cell below a column o
numbers in order to calculate a sum. I have that.

range("I1").End(xlDown).Offset(1, 0).Select 'Next Blank Cell in colum
i

I need coding to add to this line which will allow me to calculate th
sum of the column. I need the coding to account for spreadsheets wit
different numbers of rows.

Thanks

Pau
 
One way:

With Range("I1").End(xlDown)
.Offset(1, 0).Value = _
Application.Sum(Cells(1, .Column).Resize(.Row))
End With
 
Range("I1").End(xlDown).Offset(1, 0).Value = "=SUM(I1:I" & _
Range("I1").End(xlDown).Row & ")"

HTH

Die_Another_Day
 

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