Hidden rows

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
 
J

Jacob Skaria

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
 
C

camlad

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
 

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

Similar Threads


Top