ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hidden rows (https://www.excelbanter.com/excel-programming/425510-hidden-rows.html)

camlad

Hidden rows
 
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




Jacob Skaria

Hidden rows
 
Hi Camlad

You can get this without using a loop.

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

If this post is helpful click Yes
-------------
Jacob Skaria



camlad

Hidden rows
 
Brilliant - thank you Jacob

This is how it worked out:

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

I am most gateful

Camlad


"Jacob Skaria" wrote in message
...
Hi Camlad

You can get this without using a loop.

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

If this post is helpful click Yes
-------------
Jacob Skaria






All times are GMT +1. The time now is 03:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com