Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default If then, hidden rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If then, hidden rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default If then, hidden rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default If then, hidden rows


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If then, hidden rows

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If then, hidden rows

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
opening a group but keep hidden rows hidden MWL Excel Discussion (Misc queries) 0 February 17th 09 03:16 PM
Hidden rows columns won't stay hidden christie Excel Worksheet Functions 0 September 30th 08 05:44 PM
Rows hidden by Autofilter vs hidden by changing the Hidden property LEO@KCC Excel Programming 4 September 11th 07 10:14 AM
Formula or Code to keep Hidden Rows Hidden Carol Excel Worksheet Functions 6 May 1st 07 11:45 PM
I need my Hidden Rows to stay hidden when I print the sheet. Rosaliewoo Excel Discussion (Misc queries) 2 July 20th 06 07:51 PM


All times are GMT +1. The time now is 10:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"