hi.
i am using the following static Subtotal function in my macro -
Selection.Subtotal GroupBy:=2, Function:=xlCount, TotalList:=Array(6), _
Replace:=True, PageBreaks:=True, SummaryBelowData:=True
i tried to make that "6" dynamic, but surprisingly got an error message.
the code i used is something like this -
width = WorksheetFunction.CountA(Range("1:1"))
Selection.Subtotal GroupBy:=2, Function:=xlCount, TotalList:=Array(width), _
Replace:=True, PageBreaks:=True, SummaryBelowData:=True
am i missing something obvious here?
thanks,
len
i am using the following static Subtotal function in my macro -
Selection.Subtotal GroupBy:=2, Function:=xlCount, TotalList:=Array(6), _
Replace:=True, PageBreaks:=True, SummaryBelowData:=True
i tried to make that "6" dynamic, but surprisingly got an error message.
the code i used is something like this -
width = WorksheetFunction.CountA(Range("1:1"))
Selection.Subtotal GroupBy:=2, Function:=xlCount, TotalList:=Array(width), _
Replace:=True, PageBreaks:=True, SummaryBelowData:=True
am i missing something obvious here?
thanks,
len