PC Review


Reply
Thread Tools Rate Thread

SubTotal in Excel

 
 
Austin
Guest
Posts: n/a
 
      16th Sep 2009
Good Morning,

I am working with some code that exports from Access to Excel and then
subtotals in Excel. Like the code below:

With xlTop.Range("A:P")
.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=xlSummaryBelow
End With

The problem is that the width of the recordset being subtotaled on can
change (it will not necessarily be 15 columns wide). Is there a way to make
this range dynamic?

Thanks,

Austin
 
Reply With Quote
 
 
 
 
David H
Guest
Posts: n/a
 
      16th Sep 2009
Try posting in this Excel-specific newsgroup

http://www.microsoft.com/office/comm...&lang=en&cr=US

"Austin" wrote:

> Good Morning,
>
> I am working with some code that exports from Access to Excel and then
> subtotals in Excel. Like the code below:
>
> With xlTop.Range("A:P")
> .Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(3, 4, 5, 6, 7,
> 8, 9, 10, 11, 12, 13, 14, 15), _
> Replace:=True, PageBreaks:=False, SummaryBelowData:=xlSummaryBelow
> End With
>
> The problem is that the width of the recordset being subtotaled on can
> change (it will not necessarily be 15 columns wide). Is there a way to make
> this range dynamic?
>
> Thanks,
>
> Austin

 
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
Subtotal To Include Item Description On Subtotal Line Tickfarmer Microsoft Excel Misc 2 23rd Feb 2010 08:56 PM
Subtotal - Additional Formulas based on Subtotal range(s) Matt Microsoft Excel Discussion 6 4th Nov 2008 08:52 PM
macro excel subtotal in subtotal GBO Microsoft Excel Misc 2 29th Nov 2007 03:15 PM
pasting to subtotal lines without replacing hidden -non-subtotal l =?Utf-8?B?aGFybGV5ZGl2YTY3?= Microsoft Excel Misc 1 12th Oct 2006 07:02 PM
Subtotal of Subtotal displays Grand Total in wrong row Thomas Born Microsoft Excel Worksheet Functions 5 6th Jan 2005 02:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:52 PM.