Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I find out the Maximum Outline Rowlevel?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default How can I find out the Maximum Outline Rowlevel?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find in Excel 2007 the Command Show Outline Symbols rimakuja Excel Worksheet Functions 2 April 30th 08 06:07 PM
find maximum Frank Drost Excel Discussion (Misc queries) 7 January 18th 06 02:23 AM
find which column has the maximum value Frank Drost Excel Discussion (Misc queries) 2 December 15th 05 01:09 AM
How to show only one part of rowlevel 3??? Anita[_4_] Excel Programming 0 April 1st 04 01:11 AM
Find row number of maximum value CGeorges Excel Programming 2 February 2nd 04 08:51 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"