NEWBIE: How to sum cells using VBA

  • Thread starter Thread starter chuber
  • Start date Start date
C

chuber

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
 
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)
 

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