View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jef Gorbach Jef Gorbach is offline
external usenet poster
 
Posts: 59
Default 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