Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
My problem is the following: I can display certain Rowlevels by using this command: ActiveSheet.Outline.ShowLevels RowLevels:=2 But I want to find out how many rowlevels there are. Does anybody have any clue about this? Thank you in advance! Wassi -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You're looking for the highest level or the highest level visible?
This just checks visible cells: Option Explicit Sub testme99() Dim myRange As Range Dim myCell As Range Dim maxLevel As Long With ActiveSheet Set myRange = Intersect(.Columns(1), .UsedRange) _ .SpecialCells(xlCellTypeVisible) maxLevel = 0 For Each myCell In myRange.Cells If myCell.EntireRow.OutlineLevel maxLevel Then maxLevel = myCell.EntireRow.OutlineLevel End If Next myCell End With MsgBox "Largest visible level: " & maxLevel End Sub If you want all the cells, then this: Set myRange = Intersect(.Columns(1), .UsedRange) _ .SpecialCells(xlCellTypeVisible) becomes Set myRange = Intersect(.Columns(1), .UsedRange) "Wassim <" wrote: Hi! My problem is the following: I can display certain Rowlevels by using this command: ActiveSheet.Outline.ShowLevels RowLevels:=2 But I want to find out how many rowlevels there are. Does anybody have any clue about this? Thank you in advance! Wassim --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I find in Excel 2007 the Command Show Outline Symbols | Excel Worksheet Functions | |||
find maximum | Excel Discussion (Misc queries) | |||
find which column has the maximum value | Excel Discussion (Misc queries) | |||
How to show only one part of rowlevel 3??? | Excel Programming | |||
Find row number of maximum value | Excel Programming |