Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default retrieving rowlevels

Hi All,

How can I tetrieve rowlevels last set?
E.g.

After executing
ActiveSheet.Outline.ShowLevels RowLevels:=3
I want to retrieve 3.

Thanks,
Stefi

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default retrieving rowlevels

I think you're going to have to loop through the cells to find it.

I saved this from a longgggggg time ago. Maybe it'll give you an idea.

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

It just cycles through the visible cells in column A and checks to see if that's
the biggest one found.

Stefi wrote:

Hi All,

How can I tetrieve rowlevels last set?
E.g.

After executing
ActiveSheet.Outline.ShowLevels RowLevels:=3
I want to retrieve 3.

Thanks,
Stefi


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default retrieving rowlevels

Thanks, Dave, I hoped Excel provides a simple answer to this question. The
only key I found in Help was OutlineLevel property and I hardly beleived that
one has to scan all cells to retrieve this information.

Anyway, I'm going to use your code, you have spared some time for me.

Regards,
Stefi


Dave Peterson ezt *rta:

I think you're going to have to loop through the cells to find it.

I saved this from a longgggggg time ago. Maybe it'll give you an idea.

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

It just cycles through the visible cells in column A and checks to see if that's
the biggest one found.

Stefi wrote:

Hi All,

How can I tetrieve rowlevels last set?
E.g.

After executing
ActiveSheet.Outline.ShowLevels RowLevels:=3
I want to retrieve 3.

Thanks,
Stefi


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default retrieving rowlevels

I had that same feeling!

Stefi wrote:

Thanks, Dave, I hoped Excel provides a simple answer to this question. The
only key I found in Help was OutlineLevel property and I hardly beleived that
one has to scan all cells to retrieve this information.

Anyway, I'm going to use your code, you have spared some time for me.

Regards,
Stefi

Dave Peterson ezt *rta:

I think you're going to have to loop through the cells to find it.

I saved this from a longgggggg time ago. Maybe it'll give you an idea.

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

It just cycles through the visible cells in column A and checks to see if that's
the biggest one found.

Stefi wrote:

Hi All,

How can I tetrieve rowlevels last set?
E.g.

After executing
ActiveSheet.Outline.ShowLevels RowLevels:=3
I want to retrieve 3.

Thanks,
Stefi


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default retrieving rowlevels

Hi Dave,

I'm satisfied not being alone with my opinion. Anyway, the code works
perfectly, I created a function from it.

Regards,
Stefi

Dave Peterson ezt *rta:

I had that same feeling!

Stefi wrote:

Thanks, Dave, I hoped Excel provides a simple answer to this question. The
only key I found in Help was OutlineLevel property and I hardly beleived that
one has to scan all cells to retrieve this information.

Anyway, I'm going to use your code, you have spared some time for me.

Regards,
Stefi

âžDave Peterson❠ezt Ã*rta:

I think you're going to have to loop through the cells to find it.

I saved this from a longgggggg time ago. Maybe it'll give you an idea.

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

It just cycles through the visible cells in column A and checks to see if that's
the biggest one found.

Stefi wrote:

Hi All,

How can I tetrieve rowlevels last set?
E.g.

After executing
ActiveSheet.Outline.ShowLevels RowLevels:=3
I want to retrieve 3.

Thanks,
Stefi

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default retrieving rowlevels

Remember that there is no safety in numbers <vbg.

Stefi wrote:

Hi Dave,

I'm satisfied not being alone with my opinion. Anyway, the code works
perfectly, I created a function from it.

Regards,
Stefi

Dave Peterson ezt *rta:

I had that same feeling!

Stefi wrote:

Thanks, Dave, I hoped Excel provides a simple answer to this question. The
only key I found in Help was OutlineLevel property and I hardly beleived that
one has to scan all cells to retrieve this information.

Anyway, I'm going to use your code, you have spared some time for me.

Regards,
Stefi

âžDave Peterson❠ezt Ã*rta:

I think you're going to have to loop through the cells to find it.

I saved this from a longgggggg time ago. Maybe it'll give you an idea.

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

It just cycles through the visible cells in column A and checks to see if that's
the biggest one found.

Stefi wrote:

Hi All,

How can I tetrieve rowlevels last set?
E.g.

After executing
ActiveSheet.Outline.ShowLevels RowLevels:=3
I want to retrieve 3.

Thanks,
Stefi

--

Dave Peterson


--

Dave Peterson


--

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
Retrieving Data: Speed of beating down rows vs retrieving from array? (PeteCresswell) Excel Programming 2 July 9th 07 03:30 PM
Retrieving a Name of Cell cheesey_toastie Excel Programming 1 April 27th 06 11:06 AM
Outline.ShowLevels rowlevels:=1 is slow Jan Vente Excel Programming 2 May 19th 05 12:45 PM
Retrieving Value Jeff Excel Programming 4 February 14th 05 03:41 AM
Retrieving URL ChuckS Excel Programming 0 November 6th 03 09:31 PM


All times are GMT +1. The time now is 11:56 AM.

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

About Us

"It's about Microsoft Excel"