+ Reply to Thread
Results 1 to 8 of 8

Hide sheets using If Then

  1. #1
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Cool Hide sheets using If Then

    I was thinking of using an If Then that would hide selected sheets if they are unhidden.
    Of course some of these sheets may already be hidden and there may be other sheets that I wish to leave unhidden.

    Only these selected sheets in code below are of the ones in concern
    I just cant seem to get it to work…
    Please Login or Register  to view this content.
    Last edited by ABabeNChrist; 10-05-2010 at 03:10 PM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Hide sheets using If Then

    Not much point to the If test really:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Hide sheets using If Then

    Hi romperstomper
    It works great if all sheets in array are unhidden, but I receive an error even if one sheet is already hidden, not sure why.
    Error message below
    Attached Images Attached Images

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Hide sheets using If Then

    Then you will have to loop and hide each individually.

  5. #5
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Hide sheets using If Then

    Thank you romperstomper
    That’s what I did at first, but I was just trying to shorten up the code a little better.
    But thankful I only have a couple sheets that need to be hidden.
    Here are the changes I made.

    Please Login or Register  to view this content.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Hide sheets using If Then

    You can use a loop:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Hide sheets using If Then

    I guess Hans is still on holiday?

  8. #8
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Hide sheets using If Then

    YES
    I'm sure well deserved though….

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1