Counting Rows

S

shimeel

Hello,

in a macro on a worksheet using filter, i want to find out the numbe
of i have selected when those rows are not one after the other

such as:
1
2 these are selected, and 3/4/6/7/8 are filtered out, so i have
rows selected
5
9

If i just do Selection.Rows.Count, it returns 9

Shimee
 
D

Dave Peterson

MsgBox ActiveSheet.AutoFilter.Range.Columns(1) _
.Cells.SpecialCells(xlCellTypeVisible).Count

Remember to subtract 1 for the header (if you want)
 
Top