Hi all,
Firstly, this is a cross post from Mr Excel.
I'm trying to create a shortcut via a VBA macro to increase and decrease the group level that is currently on show. I have found and written some code to find the maximum level on the active sheet and can therefore expand all levels or collapse all levels at once. To open or close one level at a time I would need to have access to the current maximum level open on the sheet, not the max level in general ... is this possible? Then I could simply set the current max opened level to variable and set the program to increment or decrease this number by one each time.
I did originally set the level back to 1 as a default and track a variable but this caused problems when switching between different sheets, resulting in many uses of the shortcut sometimes before it actually decreased anything ...
Any ideas?
Many thanks.
Current code.
A kind of example of what I would like to do ...
Bookmarks