+ Reply to Thread
Results 1 to 9 of 9

hide all sheets besides exceptions

  1. #1
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    hide all sheets besides exceptions

    Hi all,

    How can I adjust below code to have the sheets "DTC", "CK", and "KA" hidden (not very hidden) and every other sheet visible BUT the sheet "Warning". The sheet "Warning" should be very hidden.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: hide all sheets besides exceptions

    Please Login or Register  to view this content.
    ps you should probably not call it showallsheets anymore
    Last edited by humdingaling; 05-06-2018 at 10:47 PM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: hide all sheets besides exceptions

    It hides the sheets "DTC", "CK", and "KA" successfully. Unfortunately is does not seem to work for the second case.

    Please Login or Register  to view this content.
    The sheet "warning" is still visible (tried with several other sheets). What am I missing here?

    ps you should probably not call it showallsheets anymore
    good call out

  4. #4
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: hide all sheets besides exceptions

    ah wait... is it because of the UCase function? some sheet names are obviously not upper case.

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: hide all sheets besides exceptions

    UCase(Sh.Name) makes all the sheets Upper case
    so when you make it go against select case statement you know what to match it against

    which then makes me think
    why is your code written
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.
    change this and try again

  6. #6
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: hide all sheets besides exceptions

    Yup. That was it! Also tried without the UCase function

    Please Login or Register  to view this content.
    which also works, but I agree that the UCase function gives less room for spelling errors.

    Thanks for your help!

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: hide all sheets besides exceptions

    UCASE is there as a catch all to stop the thing malfunctioning if someone changes the sheet name from "Warning" to wArning or WARNING or warning etc

    you can use LCASE or even PROPER
    though i would steer away form PROPER as its the easiest to misalign

  8. #8
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    481

    Re: hide all sheets besides exceptions

    okay. Good to know the other options. Will use UCase then

  9. #9
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: hide all sheets besides exceptions

    Thanks for the rep

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hide Rows in most sheets skipping hidden sheets
    By NancyPez in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-11-2016, 04:53 PM
  2. Replies: 4
    Last Post: 11-28-2015, 02:15 PM
  3. Hide all sheets (very hidden) except one or Unhide all sheets with password
    By wmdriver in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2015, 07:21 AM
  4. Comparing Multiple Columns on 2 sheets and report Exceptions on 3rd Sheet
    By KrystalQ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2014, 11:41 AM
  5. VBA to compare data on two sheets and create an exceptions report on the third
    By riptake in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2014, 06:06 AM
  6. macro to sort sheets with exceptions
    By d0wnt0wn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2008, 02:47 AM
  7. [SOLVED] Hide all sheets but selected sheets - an example
    By aztecbrainsurgeon@yahoo.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2006, 01:35 PM

Tags for this Thread

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