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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
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,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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