Ok. Gave that a try, thank you very much!
Unfortunately, this only allows you toggle between the two states "collapsed" and "max. expanded", no levels in between.
I've managed to take all levels into consideration by building a macro for each level.
With every level having its own button:
Level 1: fully collapsed
Level 2: what you have grouped in level 2
Level 3: fully expanded
For example, the levels "beta" look like this:
beta Level 1:
beta Level 2:
beta Level 3:
As you can see, Level 2 consists of 3 ranges, the highlighted Level-2-range (= row 14) being in the middle.
As far as I can tell from trying, the ShowDetail property doesn't allow you to do this.
It seems to work with a/the corresponding row number automatically "assigned" by the group it consists of.
With the ShowDetail property, you can say:
beta Level 1:
beta Level 3:
Levels 1 and 3 work fine, since the ranges are not interrupted.
But it seems, you can't set a range a) other than what your grouping consists of or b) an interrupted one.
So Level 2 doesn't work this way.
But: playing around with the function again, I came to realize, that it works with
instead of
I've tested the function again: it does exactly, what you would expect.
The Outline Level property does take interrupted ranges into consideration.
"Clicking" on Level 2, beta's Level 2 will be displayed, which is equivalent to row 14.
So my guess is: if the function can be tweaked to work with ranges, this would be the neatest way to go.
The function checks the whole worksheet:
How would you say "use this range", e.g. for beta:
Wouldn't this do?
Thank you!
Bookmarks