Need Macro to remove all grouping

floridagunner

Board Regular
Joined
Jul 20, 2007
Messages
60
I need a macro that will do away with all grouping on a worksheet. I was using the following code to remove all row groupings from my worksheet:

Code:
Cells.Select
Selection.Rows.Ungroup
Selection.Rows.Ungroup

This was working fine when I had spreadsheets with only two groups of rows. But I now have spreadsheets with multiple row groups ranging from 2-8.

I tried the code listed on a question posted previously here:

http://www.mrexcel.com/forum/showthread.php?t=373642


Code:
Sheets("YourSheet").Outline.ShowLevels 8


However this solution simply unhides all grouped rows. What I need to do is

REMOVE ANY AND ALL GROUPING THAT MAY EXIST ON THE WORKSHEET.

Hope someone can help me.

Thanks
floridagunner
 
Last edited:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
floridagunner,

Can you give us a sample workbook, with one worksheet containing column and row groups, and with any other groupings you may be using?


You can upload your workbook to Box Net,

sensitive data scrubbed/removed/changed

mark the workbook for sharing
and provide us with a link to your workbook.
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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