PC Review


Reply
Thread Tools Rate Thread

Column Subtotal Question

 
 
brentm
Guest
Posts: n/a
 
      5th Jan 2009
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 With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      5th Jan 2009
>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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"brentm" <(E-Mail Removed)> wrote in message
news:9B4CF54E-0B8A-45F5-AB36-(E-Mail Removed)...
>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 With Quote
 
ryguy7272
Guest
Posts: n/a
 
      5th Jan 2009
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using VBA, subtotal a column only if there is more than one qualifier Joanne Microsoft Excel Programming 5 17th Apr 2011 02:50 PM
Subtotal Levels in Column Edgar Microsoft Excel Misc 0 10th Dec 2009 07:36 PM
column subtotal Mel Microsoft Excel Worksheet Functions 0 6th Aug 2008 04:38 PM
Subtotal in new column Pete Provencher Microsoft Excel Misc 2 26th May 2004 09:47 PM
Missing column in subtotal Alan Microsoft Excel Discussion 4 4th Jan 2004 03:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:44 AM.