ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programatic Subotal Question (https://www.excelbanter.com/excel-programming/382853-programatic-subotal-question.html)

PK

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!

PK

Programatic Subotal Question
 
Clarification - when i said "subtotal field" i meant subtotal command.
thanks



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com