Hi Mark,
There are 3 possible answers but it depends on how you are hiding the rows.
1) If you are using Autofilter then the SubTotal() function will work.
=SubTotal(9,A1:A10) will sum only visible rows in the range A1 to A10
=SubTotal(3,A1:A10) will count only visible rows in the range A1 to A10
2) If you are MANUALLY hidding the rows AND you have Excel 2003, you can use
the new feature of the SubTotal() function...
=SubTotal(109,A1:A10) will sum only visible rows in the range A1 to A10
3) If you are MANUALLY hidding the rows AND you DO NOT have Excel 2003, you
need a macro to do this such as the one below.
'/=============================================/
Public Function Sum_Visible_Range(rng As Range) As Variant
'sum numbers in visible rows and columns only
Dim rngCell As Range
Dim varSum As Variant
Application.Volatile
varSum = 0
For Each rngCell In rng
If IsNumeric(rngCell.Value) = True Or _
IsDate(rngCell.Value) Then
If rngCell.EntireRow.Hidden = False And _
rngCell.EntireColumn.Hidden = False Then
varSum = varSum + rngCell.Value
End If
End If
Next rngCell
Sum_Visible_Range = varSum
End Function
'/=============================================/
HTH,