Counting Rows

  • Thread starter Thread starter shimeel
  • Start date Start date
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
 
MsgBox ActiveSheet.AutoFilter.Range.Columns(1) _
.Cells.SpecialCells(xlCellTypeVisible).Count

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top