View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Count number of rows, where non relevant rows are hidden

Enter and run this small sub:

Sub IAmTheCount()
Dim r As Range, c1 As Long, c2 As Long

For Each r In ActiveSheet.UsedRange.Rows
If r.Hidden Then
c1 = c1 + 1
Else
c2 = c2 + 1
End If
Next
MsgBox (c1 & " rows are hidden")
MsgBox (c2 & " rows are not hidden")
End Sub


It will report the number of hidden and un-hidden rows in your used range.
--
Gary's Student


"Pieter" wrote:

I want to count the number of rows i a worksheet. I have hidden the non
relevant rows in the sheet.