Programatic Subotal Question

G

Guest

Hi!

I think the solution to this may be easy but it is eluding me...

I need to be able to programatically subtotal, but will programatically vary
which columns i will be totalling.

Here is a sample of the subtotal line:

Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(6, 7),
Replace:=True, PageBreaks:=False, SummaryBelowData:=True


Here is what i need to do: I want to be able to put "6,7" in a variable
(this will be varied based on the circumstances) and plug it into the
subtotal field. The reason i want to do this is because I am actually
creating the spreadsheet from Excel, and the number of columns will vary. I
want my program to begin subtotalling at column 6 thru the right-most column.

Thanks!
 

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

Similar Threads

Issue with nested data subtotals 3
Subtotal function 2
Subtotal by VBA 5
Subtotal Formatting 2
subtotal question 1
Subtotals 2
Subtotal macro in each worksheet 13
sub total array 1

Top