Get the number of records found by autofilter in excel
Posted on 2013-12-11
WHen you apply an autofilter to a list, you see in the status bar at the bottom something like "4 of 17 records found"
How do I put this into a variable ( I want my variable to become 4 if the autofilter found 4 records. the 4 must be somewhere already,so how do you go straight to that? so please do not give me something where I loop through the worksheet.
So my code is:
dim strCrit as string
dim n long
ActiveSheet.Range("A:J").AutoFilter Field:=8, Criteria1:=strCrit
what gives me the number of found records?