ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to group rows using VBA (https://www.excelbanter.com/excel-programming/391207-how-group-rows-using-vba.html)

[email protected]

How to group rows using VBA
 
I am trying to group several rows in Excel using VBA. The following
command seems to work if I want to group rows 6 thru 10:

ActiveSheet.Range("6:10").Group

How do I collapse this group using VBA so that the workbook doesn't
show the rows in the group (equivalent to clicking on the little
"minus" button)? There must be a property that can be accessed, but I
haven't found it...

Thanks,

Andre


Ben McBen

How to group rows using VBA
 
depending on your intent use:

~ .Outline.ShowLevels

" wrote:

I am trying to group several rows in Excel using VBA. The following
command seems to work if I want to group rows 6 thru 10:

ActiveSheet.Range("6:10").Group

How do I collapse this group using VBA so that the workbook doesn't
show the rows in the group (equivalent to clicking on the little
"minus" button)? There must be a property that can be accessed, but I
haven't found it...

Thanks,

Andre




All times are GMT +1. The time now is 05:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com