Thread: VBA SUM
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default VBA SUM

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


"Edgar" wrote in message
...
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