View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
PK PK is offline
external usenet poster
 
Posts: 69
Default Programatic Subotal Question

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!