ExcelBanter

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

camlad

Are rows hidden
 
Thanks to help from Nigel yesterday, I now have a macro which detects empty
cells in C2-C10 and hides those rows leaving other rows alone.



I should like to toggle that so is there a code for "are any rows hidden"
without going from row to row throughout the database?



If Rows.hidden = true then

Rows.unhide

Else

HideEmptyRows 'the macro to hide empty rows

Endif



Any suggestions - thanks



Camlad



Mike H

Are rows hidden
 
Hi,

maybe this

Range("C2:C10").EntireRow.Hidden = False

then your code to hide empty rows

Mike

"camlad" wrote:

Thanks to help from Nigel yesterday, I now have a macro which detects empty
cells in C2-C10 and hides those rows leaving other rows alone.



I should like to toggle that so is there a code for "are any rows hidden"
without going from row to row throughout the database?



If Rows.hidden = true then

Rows.unhide

Else

HideEmptyRows 'the macro to hide empty rows

Endif



Any suggestions - thanks



Camlad




camlad

Are rows hidden
 
Thanks Mike - easy when you know how.

Camlad

"Mike H" wrote in message
...
Hi,

maybe this

Range("C2:C10").EntireRow.Hidden = False

then your code to hide empty rows

Mike

"camlad" wrote:

Thanks to help from Nigel yesterday, I now have a macro which detects
empty
cells in C2-C10 and hides those rows leaving other rows alone.



I should like to toggle that so is there a code for "are any rows hidden"
without going from row to row throughout the database?



If Rows.hidden = true then

Rows.unhide

Else

HideEmptyRows 'the macro to hide empty rows

Endif



Any suggestions - thanks



Camlad






camlad

Are rows hidden
 
Oh! No Mike, it is not right now I have tried it.

Sub ToggleHideUnhideRows()
If Range("C2:C10").EntireRow.Hidden = False Then
OpenUp
Else
HideBlankDates
End If
End Sub

Open up works all the time even if they ARE open so the toggle
(HideBlankDates) is never run.

"If Range("C2:C10").EntireRow.Hidden = False" should be false if no rows are
hidden.

Thinking about it "C2:C10" is irrelevant. We want to test if ANY row in the
sheet is hidden.

Can you do that?

Camlad


"Mike H" wrote in message
...
Hi,

maybe this

Range("C2:C10").EntireRow.Hidden = False

then your code to hide empty rows

Mike

"camlad" wrote:

Thanks to help from Nigel yesterday, I now have a macro which detects
empty
cells in C2-C10 and hides those rows leaving other rows alone.



I should like to toggle that so is there a code for "are any rows hidden"
without going from row to row throughout the database?



If Rows.hidden = true then

Rows.unhide

Else

HideEmptyRows 'the macro to hide empty rows

Endif



Any suggestions - thanks



Camlad






Jacob Skaria

Are rows hidden
 
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 08:13 PM.

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