Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all,
If rows a4-a10 are hidden, then un-hide, but if they are un-hidden, then hide. Looking for a VB. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should work (just set the worksheet reference according to your
needs)... Dim R As Range For Each R In Worksheets("Sheet1").Rows("4:10") R.Hidden = Not R.Hidden Next Rick "pgarcia" wrote in message ... Hello all, If rows a4-a10 are hidden, then un-hide, but if they are un-hidden, then hide. Looking for a VB. Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
GOD, I have to take a class one of these days.
Thanks you very much. It's got a cool "wow" factor when I have the VB code in a com button. "Rick Rothstein (MVP - VB)" wrote: This should work (just set the worksheet reference according to your needs)... Dim R As Range For Each R In Worksheets("Sheet1").Rows("4:10") R.Hidden = Not R.Hidden Next Rick "pgarcia" wrote in message ... Hello all, If rows a4-a10 are hidden, then un-hide, but if they are un-hidden, then hide. Looking for a VB. Thanks. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() With Rows("4:10") .Hidden = Not .Hidden End With -- __________________________________ HTH Bob "pgarcia" wrote in message ... Hello all, If rows a4-a10 are hidden, then un-hide, but if they are un-hidden, then hide. Looking for a VB. Thanks. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That seems to be simply unhiding all the hidden rows in that range for me;
it does seem to hide the currently unhidden ones. Are you seeing it work differently than that? Rick "Bob Phillips" wrote in message ... With Rows("4:10") .Hidden = Not .Hidden End With -- __________________________________ HTH Bob "pgarcia" wrote in message ... Hello all, If rows a4-a10 are hidden, then un-hide, but if they are un-hidden, then hide. Looking for a VB. Thanks. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Actually, in looking at it closer, it seem to be setting the Hidden property
of the entire range to the opposite of what Row 4's (the first row in the range's) Hidden property is set to. Rick "Rick Rothstein (MVP - VB)" wrote in message ... That seems to be simply unhiding all the hidden rows in that range for me; it does seem to hide the currently unhidden ones. Are you seeing it work differently than that? Rick "Bob Phillips" wrote in message ... With Rows("4:10") .Hidden = Not .Hidden End With -- __________________________________ HTH Bob "pgarcia" wrote in message ... Hello all, If rows a4-a10 are hidden, then un-hide, but if they are un-hidden, then hide. Looking for a VB. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
opening a group but keep hidden rows hidden | Excel Discussion (Misc queries) | |||
Hidden rows columns won't stay hidden | Excel Worksheet Functions | |||
Rows hidden by Autofilter vs hidden by changing the Hidden property | Excel Programming | |||
Formula or Code to keep Hidden Rows Hidden | Excel Worksheet Functions | |||
I need my Hidden Rows to stay hidden when I print the sheet. | Excel Discussion (Misc queries) |