Hidden rows

  • Thread starter Thread starter camlad
  • Start date Start date
C

camlad

I need to test if any row is hidden without opening them up.
Can anyone suggest an alternative to testing each row

Count = Cells(Rows.Count, 1).End(xlUp).Row
Count = 1
While Row(Count,1).hidden = false
Count = Count + 1
Wend

Which I have not tried that yet, it should work but seems messy

Camlad
 
Hi Camlad

You can get this without using a loop.

ActiveSheet.Rows.Count - Range("A1:A" &
ActiveSheet.Rows.Count).Rows.SpecialCells(xlCellTypeVisible).Count

If this post is helpful click Yes
 
Brilliant - thank you Jacob

This is how it worked out:

Sub ToggleHideUnhideRows()
If ActiveSheet.Rows.Count - Range("A1:A" & _
ActiveSheet.Rows.Count).Rows.SpecialCells(xlCellTypeVisible).Count
<> 0 Then
OpenUp
Else
HideBlankDates
End If
End Sub

I am most gateful

Camlad
 
Back
Top