View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default NEWBIE: How to sum cells using VBA

As an example

iLastRow = Cells(Rows.Count,"D").End(xlUp).Row

Cells(iLastRow+1,"D").Formula = "=SUM(D1:D" & iLastRow & ")"

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"chuber" wrote in message
oups.com...
Brand new and trying my best at VBA ... in advance, thank you for your
help!

My worksheets will have a different number of rows each time they are
generated. Trying to show the sum for Column C, Column D and Column E
(individually). I can write the code to show the sum, but it requires
that I have the cursor in the specific cell.

Want to be able to run the macro, have it find the last row with
numbers, then jump down one row and show the sum for each column.

--Chris