LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Range properties from Array variables

I know that it is faster to grab an range of cells and send it to an array.
Can I then access Range properties from that array? For example, I want to
Sum all cells in a range that are not header rows (i.e. rows that contain a
'+'). To do this, I need to check the OutlineLevel property.

Example code:

Public Function SumIfNotHeading(ByRef rng As Range) As Double

SumIfNotHeading = 0

' Add cell value if row has not a header
Dim cell As Range
For Each cell In rng
If Not bIsHeading(cell) Then
SumIfNotHeading = SumIfNotHeading + cell.Value
End If
Next cell

End Function

Function bIsHeading(ByRef rng As Range) As Boolean
bIsHeading = (rng.EntireRow.OutlineLevel < rng.Offset(1,
0).EntireRow.OutlineLevel)
End Function

Is this possible, or is there a better way? Thanks.

Matthew Pfluger
 
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
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) Keith R[_2_] Excel Programming 3 November 13th 07 04:08 PM
Array Properties in a Class [email protected] Excel Programming 7 May 2nd 07 05:52 PM
XL 2003: ListBox ListCount (and other) properties missing from Local Variables window Michel S. Excel Programming 3 February 14th 07 07:35 PM
Save Cell Properties into an Array [email protected] Excel Programming 6 March 1st 06 03:30 PM
How to use array formula for three variables? MelissaS Excel Discussion (Misc queries) 2 January 20th 05 01:16 PM


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