Variable in Subtotal

G

gatarossi

Dear all,

I'm trying to put a subtotal in my list, but in some cases I have
three columns to sum (4,5,6); some case I have more or less columns to
sum; it's variable.

How can change this code to obtain it?

Range(Cells(7, 1), Cells(65536, 256)).Subtotal GroupBy:=1,
Function:=xlSum, TotalList:=Array(4, 5, 6), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True

Thanks a lot!!!

André.
 
Top