ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Collapsing Grouped rows by Macro (https://www.excelbanter.com/excel-programming/359818-collapsing-grouped-rows-macro.html)

Philip J Smith

Collapsing Grouped rows by Macro
 
I have a report which contains some grouped rows.
In each case the rows are grouped into a total above.
The working status of the groups should be all rows desplayed.
Before printing I would like to collapse some of the groups so that only the
totals are shown.

I have tried.

Range("NewPLTradeIncome").OutlineLevel = 1

This fails:

I get the error report

"Unable to set the OutlineLevel property of the range class"

Can anyone point me in the right direction please?

Tom Ogilvy

Collapsing Grouped rows by Macro
 
Turn on the macro recorder and then manually collapse the rows.

Now expand them.

Turn off the macro recorder. Look at the recorded code. It should give you
some insight into what you need to do.


--
Regards,
Tom Ogilvy


"Philip J Smith" wrote:

I have a report which contains some grouped rows.
In each case the rows are grouped into a total above.
The working status of the groups should be all rows desplayed.
Before printing I would like to collapse some of the groups so that only the
totals are shown.

I have tried.

Range("NewPLTradeIncome").OutlineLevel = 1

This fails:

I get the error report

"Unable to set the OutlineLevel property of the range class"

Can anyone point me in the right direction please?



All times are GMT +1. The time now is 10:28 AM.

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