>I am writing to excel line by line
>It is a Balance sheet
>
>some lines are totals by account which are only sometimes important.
>I would like to make a subtotal similar to the built in excel subtotal only that it shall be created through automation for a certain number of rows, and by default it should be collapsed.
>If the user thinks there is something strange with a total (e.g. Total assets) s/he can click on the plus in the left margin and expand to see all account belonging to this group.
>
>
>can that be accomplished
>something like this:
>
>
> .Rows("9:23").Subtotal( GroupBy:=1, Function:=xlSum, TotalList:=Array(8), Replace:=True, PageBreaks:=False, SummaryBelowData:=True )
>
>
>
>Or does anybody have a better idea?
>
>Thanks
>
>
>Peter
Yes it can be if first row can identify labels. My suggestion instead of hardcoded row ranges use named ranges. Check Thread #
975882 < g >
Cetin