vba - grouping/ungrouping

shodan

Active Member
Joined
Jul 6, 2005
Messages
486
Dear board,

In my file I have grouped some lines. In total I have 4 subgroups within each mastergroup.
Now I would like to add a button to collaps some of the mastergroups. My first intention was to do this very simple via hide/unhide. However, if some of the groups where collapsed before I hide all, they are all expanded again when I Unhide these rows. Indeed it seems logical that it is being done this way, since that is what I ask, but it is of course not what I want. when I do the unhide, I would like to have the same view again as before. When using the macro recorder, I don't see any coding returned.

Hopefully I explained this more or less clear. Is there someone out here who can help me with this?

Thanks!
shodan
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,224,586
Messages
6,179,726
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top