David Schaleger
Board Regular
- Joined
- Dec 6, 2010
- Messages
- 55
Please help me with code that inserts or deletes an appropriate number of rows when expanding or collapsing pivot tables that would otherwise overlap another pivot table when expanded.
I have several pivot tables stacked on top of each other on one sheet, all with the same column headers (year.mo). I have two rows between each PT. When I expand fields in any PT, the code should probably count how many rows need to be inserted below the PT to accommodate the new PT height, and then insert them before expanding the field data, leaving two rows between the newly expanded PT and the one below it. The reverse should happen when collapsing, leaving two rows in between the PT's. This, of course, is not necessary with the last (lowest or bottom most) PT, although it shouldn't be a problem if it did, and would probably simplify the code
I'm starting to get a little savvy with VBA, but I SUCK at referencing PT's!
Thank you.
I have several pivot tables stacked on top of each other on one sheet, all with the same column headers (year.mo). I have two rows between each PT. When I expand fields in any PT, the code should probably count how many rows need to be inserted below the PT to accommodate the new PT height, and then insert them before expanding the field data, leaving two rows between the newly expanded PT and the one below it. The reverse should happen when collapsing, leaving two rows in between the PT's. This, of course, is not necessary with the last (lowest or bottom most) PT, although it shouldn't be a problem if it did, and would probably simplify the code
I'm starting to get a little savvy with VBA, but I SUCK at referencing PT's!
Thank you.