When you use an autofilter to filter results, Excel doesnβt even hide them: it just sets the line height to zero (until 2003, at least not sure about 2007).
Thus, the following user-defined function should give you a starter to do what you want (checked by integers, did not play with anything else):
Function SumVis(r As Range) Dim cell As Excel.Range Dim total As Variant For Each cell In r.Cells If cell.Height <> 0 Then total = total + cell.Value End If Next SumVis = total End Function
Edit:
You will need to create a module in the book to enable the function, then you can just call it on your sheet, like any other function (= SumVis (A1: A14)). If you need help setting up the module, let me know.
mavnn Apr 17 '09 at 9:32 2009-04-17 09:32
source share