Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Counting number of grouped/outlined rows

Hello,

I use the outline/group-functionality very extensively so that I
always use 3-5 levels of them. Now in my program it is necessary for
me to know how many rows are part of an outline.
So I just closed the group, counted the number of visible rows, opened
the group and again counted the number of rows - the difference then
is the number of rows inside the group/outline.
But now I recognized that it no more works if inside of that group
again groups exist which are closed. Then all the rows of this
group/outline are just counted as one row, but not the number of all
the rows inside of it.

So is there are any possibility to get the number of rows inside one
group/outline easily?

I know, I could open all groups/outlines inside the one I have to
count recursively, but due to my huge worksheets this will take quite
long so that this is nearly impossible for me.

Does anyone have any idea or just a hint what I could do?

Thanks in advance.
Dirk
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Counting number of grouped/outlined rows

Dirk Flakowski wrote:
So is there are any possibility to get the number of rows inside one
group/outline easily?


Function NumberOfRowsInOutlineLevel(Level As Integer) As Long
Dim R As Range
Dim L As Long
For Each R In ActiveSheet.UsedRange.EntireRow.Rows
If R.OutlineLevel = Level Then L = L+1
Next
NumberOfRowsInOutlineLevel = L
End Function



Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

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
Counting number of rows Lynne Mawson New Users to Excel 1 May 8th 08 05:56 PM
Counting number of rows Lynne Mawson New Users to Excel 0 May 8th 08 03:53 PM
Grouped/outlined data only graphs when visible [email protected] Charts and Charting in Excel 2 June 23rd 06 02:55 PM
Can I sum an outlined Excel sheet and ignore collapsed rows? DennisB Excel Worksheet Functions 2 June 22nd 06 02:01 AM
sorting a sheet with outlined rows Ron Excel Discussion (Misc queries) 0 June 8th 06 04:25 PM


All times are GMT +1. The time now is 04:15 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"