hidden cells


Posted by Larry Kassen on February 09, 2002 9:06 AM

I want to keep cells hidden but not have their values included in the sum.

Posted by Larry Kramer on February 09, 2002 1:11 PM

Take a look at the Subtotal() function in Help. I think =Subtotal(9,range) is what you need.

Posted by Leofwine on February 09, 2002 1:43 PM


But only works on an auto-filtered list.
Otherwise, need a UDF.

Posted by Larry Kramer on February 09, 2002 4:48 PM



Posted by Larry Kramer on February 09, 2002 4:49 PM

Leofwine is corrrect. Here's my penance:

Function VisibleSum(rRange As Range) As Double

Dim iLine As Integer, iLines As Integer

iLines = rRange.rows.Count
For iLine = 1 To iLines
If rRange.rows(iLine).Hidden = False Then VisibleSum = VisibleSum + rRange.Cells(iLine)
Next iLine
End Function