Excel VBA - Random extra grouping levels -
this not issue affects code rather question of table's appearance. so, table summary of records income , expenses of different business departments. let's call each department type of record. each of types has subtype1. each subtype1 has subtypes2 , each subtype2 has subtypes3. sample data this.
1, type1, sum of subtypes1 1.1, subtype1, sum of subtypes2 1.1.1 subtype2, sum of subtypes3 1.1.1.1 subtype3, amount 1.1.1.2 subtype3, amount 1.2, subtype1, sum of subtypes2 1.2.1, subtype2, sum of subtypes3 1.2.1.1, subtype3, amount each subtype can have different number of "children subtypes". children subtypes can't go further subtype3.
then using vba script group records of same subtype under direct parent main type. works fine, can expand or hide every single level of structure. however, logically group outline on left side of table rows should show 4 levels. instead shows 8 levels of groups. first 4 expect, show or hide respective subtypes while other 4 levels absolutely nothing expected because don't see reason them there.
any ideas why levels have been created , how rid of them? might have explained in not clear way feel free ask further information.
try stepping through code in trace mode watch groups being set up. (open vba window , use f8 key loop 1 line @ time) may reveal why groups being defined , suggest change.
Comments
Post a Comment