B
Bob Phillips
As you want manually hidden as well as autofiltered, try this UDF
First add this UDF
Function IsVisible(ByVal Target As Range)
Dim oRow As Range
Dim i As Long
Dim ary()
ReDim ary(1 To 1, 1 To Target.Rows.Count)
i = 0
For Each oRow In Target.Rows
i = i + 1
ary(1, i) = Not oRow.EntireRow.Hidden
Next oRow
IsVisible = ary
End Function
Then use this formula
=SUM(TRANSPOSE(isvisible(C1:C20))*(C1:C20))
which is an array formula, so commit with Ctrl-Shift-Enter.
If the rows are manually hidden, hiding/unhiding does not trigger the UDF,
so you will need to F9.
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
First add this UDF
Function IsVisible(ByVal Target As Range)
Dim oRow As Range
Dim i As Long
Dim ary()
ReDim ary(1 To 1, 1 To Target.Rows.Count)
i = 0
For Each oRow In Target.Rows
i = i + 1
ary(1, i) = Not oRow.EntireRow.Hidden
Next oRow
IsVisible = ary
End Function
Then use this formula
=SUM(TRANSPOSE(isvisible(C1:C20))*(C1:C20))
which is an array formula, so commit with Ctrl-Shift-Enter.
If the rows are manually hidden, hiding/unhiding does not trigger the UDF,
so you will need to F9.
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)