SubTotal in Excel

A

Austin

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
 

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