VBA SUM

  • Thread starter Thread starter Edgar
  • Start date Start date
E

Edgar

Is there some way of adding some VBA to add a sum formula
in the last row of some data i have. I would need the sum
in Column C.

Thanks
 
Edgar,

Try something like the following:

Dim Rng As Range
Set Rng = Cells(Rows.Count, "C").End(xlUp)(2, 1)
Rng.Formula = "=SUM(C1:" & Rng(0, 1).Address(False, False) & ")"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top