Is RowHeight=0 the same as Hidden

M

Michelle

I'm manipulating rows, and I want to know if I can distinguish between rows
that have been hidden, and rows that have been set to RowHeight = 0.

Thanks

M
 
P

Peter T

If you hide a row its height becomes 0
If you set a row's height to 0 it becomes hidden

AFAIK there is no way to distinguish which method was used to hide and make
the height 0.

Regards,
Peter T
 
G

Gary''s Student

If you set the row height to zero, the Hidden property of that row will
become True.
It is usually better to Hide the row because it is then not necessary to
"remember" what the height used to be before you hid it.
 
D

Dana DeLouis

I'm manipulating rows, and I want to know if I can distinguish between
rows that have been hidden, and rows that have been set to RowHeight = 0.

Thanks

M

Just note that in Excel 2007, the row is "Hidden" even with a value of 0.5.
Don't quote me on this, but I believe in versions around Excel 97, a Row
height of 1 or 2 also returned true.

Sub Demo()
Rows(1).RowHeight = 0.5
Debug.Print Rows(1).Hidden ' <- True
End Sub


= = = = = = =
HTH :>)
Dana DeLouis
 
M

Michelle

That is a great answer - thanks

M

Dana DeLouis said:
Just note that in Excel 2007, the row is "Hidden" even with a value of
0.5.
Don't quote me on this, but I believe in versions around Excel 97, a Row
height of 1 or 2 also returned true.

Sub Demo()
Rows(1).RowHeight = 0.5
Debug.Print Rows(1).Hidden ' <- True
End Sub


= = = = = = =
HTH :>)
Dana DeLouis
 

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

Top