Automate excel subtotals from access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've got an Access2k app that exports sales data to an excel2k ss. I've got
the data sorted up ok but now I want to have subtotals generated. Can anyone
help me make that happen?

Thanks, Bear
 
With xlSheet
.Range(.Cells(lngFirstDataRow - 1, 1), _
.Cells(lngLastDataRow, 19)).Subtotal groupBy:=1,
Function:=xlSum, _
totalList:=Array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19)
End With

the groupby value is the column of the range you want to subtotal on.
the Function is what you want to do
the totallist is the columns you want included
 
Thanks Klatuu, that will be a big help.

Bear

Klatuu said:
With xlSheet
.Range(.Cells(lngFirstDataRow - 1, 1), _
.Cells(lngLastDataRow, 19)).Subtotal groupBy:=1,
Function:=xlSum, _
totalList:=Array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19)
End With

the groupby value is the column of the range you want to subtotal on.
the Function is what you want to do
the totallist is the columns you want included
 
Back
Top