Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Column Subtotal Question

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!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Column Subtotal Question

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



--
RyGuy


"brentm" wrote:

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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtotal question [email protected] Excel Worksheet Functions 4 August 14th 08 12:05 AM
subtotal question? wonderdogs828 Excel Worksheet Functions 2 January 3rd 06 11:08 PM
subtotal question wonderdogs828 Excel Discussion (Misc queries) 1 January 3rd 06 10:13 PM
subtotal question Gary Keramidas Excel Programming 1 October 11th 05 02:15 PM
subtotal question hans[_4_] Excel Programming 1 April 6th 05 12:25 PM


All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"