=subtotal(102,Range)

This would count the number of unhidden elements in the range.