Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: Sumif with filtered rows 1

Status
Not open for further replies.

ebrooks54

IS-IT--Management
Dec 4, 2002
54
US
I'm looking for a way to create something that duplicates the way the sumif function works in Excel, except that it works the way the subtotal function works and ignores rows that are hidden because of an auto-filter.

Alternately, is there a function that indicates whether a row is hidden or not? Does anyone have the code for a user defined function that would indicate whether a row is hidden?

Thanks
 
Hi,
Code:
Function SumVisible(rng As Range)
    Dim r As Range
    Application.Volatile
    For Each r In rng
        If Not r.EntireRow.Hidden Then
            SumVisible = SumVisible + r.Value
        End If
    Next
End Function


Skip,

[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top