I would like to count the number of cells still visible after an autofilter. I know the Excel SUBTOTAL function will do this. I must be doing something incorrectly because this isn't happening for me.
My code looks like this:
Fund_table is a table imported from Access, Id is the integer I'm looking for, and FundId is a named range (a column within Fund_table). I get no errors from the code, but the result of the subtotal is the total number of rows, and not just the visible ones. Either I'm not applying the autofilter correctly or subtotal is counting more than it should.
Any help would be appreciated.
Sarah
-don't panic, I'm mostly harmless-
My code looks like this:
Code:
...
Range("Fund_table").AutoFilter Field:=2, Criteria1:=Id, VisibleDropDown:=False
If Application.Evaluate("SUBTOTAL(3, FundId)") = 0 Then
...
Fund_table is a table imported from Access, Id is the integer I'm looking for, and FundId is a named range (a column within Fund_table). I get no errors from the code, but the result of the subtotal is the total number of rows, and not just the visible ones. Either I'm not applying the autofilter correctly or subtotal is counting more than it should.
Any help would be appreciated.
Sarah
-don't panic, I'm mostly harmless-