ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Outline.ShowLevels (https://www.excelbanter.com/excel-programming/327809-outline-showlevels.html)

Kevin McCartney

Outline.ShowLevels
 
Hi TWIMC,

Is there a way that if I set the outline.showlevel to 2, that all levels
below are collapsed, so that if a user clicks on the 3rd level, levels 4, 5
and 6 don't show. Or is there a way to find out how many row levels there are
so that I can collapse each level and then set outline.showlevel to 2?

e.g.
for Z = worksheet.rowlevels.count to 1 Step -1
worksheet.outline.levels = Z
Next Z

worksheet.outline.levels = 2

TIA
KM

Jef Gorbach

Outline.ShowLevels
 

"Kevin McCartney" wrote in
message ...
Hi TWIMC,

Is there a way that if I set the outline.showlevel to 2, that all levels
below are collapsed, so that if a user clicks on the 3rd level, levels 4,

5
and 6 don't show. Or is there a way to find out how many row levels there

are
so that I can collapse each level and then set outline.showlevel to 2?

e.g.
for Z = worksheet.rowlevels.count to 1 Step -1
worksheet.outline.levels = Z
Next Z

worksheet.outline.levels = 2

TIA
KM


try:
ActiveSheet.Outline.ShowLevels RowLevels:=2 'show outline level
2




Kevin McCartney

Outline.ShowLevels
 
ActiveSheet.Outline.ShowLevels RowLevels:=2 'show outline level

this doesn't collapse, levels 3, 4, 5 or 6

Still need help

"Jef Gorbach" wrote:


"Kevin McCartney" wrote in
message ...
Hi TWIMC,

Is there a way that if I set the outline.showlevel to 2, that all levels
below are collapsed, so that if a user clicks on the 3rd level, levels 4,

5
and 6 don't show. Or is there a way to find out how many row levels there

are
so that I can collapse each level and then set outline.showlevel to 2?

e.g.
for Z = worksheet.rowlevels.count to 1 Step -1
worksheet.outline.levels = Z
Next Z

worksheet.outline.levels = 2

TIA
KM


try:
ActiveSheet.Outline.ShowLevels RowLevels:=2 'show outline level
2






All times are GMT +1. The time now is 03:45 AM.

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