Column Subtotal Question

B

brentm

I have a spreadsheet that I need to add a column subtotal for column C and
column D. the number of rows will vary from one run to the next. the other
issue I have is that all rows with a value in column D are listed (by sort)
below all rows with a value in column C. I can add subtotals, but I do not
know how to set the range to be dynamic. Also, I need the subtotals to be 2
rows below the last row with a value in column D. I am stumped!
 
D

Don Guillett

I need the subtotals to be 2 rows below the last row with a value in
column D. I am stumped!

You would need to have the value set by a macro
 
R

ryguy7272

Something like this:

Dim lastrow as Long
lastrow = .Cells(.Rows.Count, "C").End(xlUp).Row
.Cells(lastrow, "C").Activate
ActiveCell.FormulaR1C1 = "=sum(r6c:r[-1]c)"

HTH,
Ryan---
 

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

Top