THE SHEET IS ALREADY AUTO FILTERED
Then try this macro
the total rows include header row alsoVB:Sub filt_rows() Dim filt As Range, j As Integer, totalrows As Integer Set filt = Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible) MsgBox filt.Areas.Count totalrows = 0 For j = 1 To filt.Areas.Count totalrows = totalrows + filt.Areas(1).Rows.Count Next j MsgBox totalrows ActiveSheet.AutoFilterMode = False End Sub
the code given below is an optional code. if you do not want it you can removed from the macro
VB:ActiveSheet.AutoFilterMode = False


Reply With Quote
Bookmarks