+ Reply to Thread
Results 1 to 7 of 7

Hide any other sheet than the active one

  1. #1
    Registered User
    Join Date
    11-11-2021
    Location
    France
    MS-Off Ver
    2021
    Posts
    22

    Hide any other sheet than the active one

    I have a file with various sheets ; one is the main hub from which all others are accessible (those are hidden) through buttons with macros.

    I'm trying to find a more elegant (and working) solution to the initial "code" I'm using right now (I assign a variation of this on each button that navigates through the pages) :

    Sheets("Kiosk").Visible = True
    Sheets("Support").Visible = False
    Sheets("Divers").Visible = False
    Sheets("Other").Visible = False
    Sheets("Herbier").Visible = False
    Sheets("Templates").Visible = False
    Sheets("addresses").Visible = False
    Sheets("Test").Visible = False
    Sheets("Classified As UnClassified").Visible = False
    Sheets("Proc?dures").Visible = False
    Sheets("Quotes").Visible = False
    Sheets("LinkCheck").Visible = False
    Sheets("Repair").Visible = False

    --------------------------------------

    I wanted to find something a bit less cumbersome, that wouldn't need to constantly edit each code whenever a new page gets added to the file - it doesn't happen that often now, but it still remains long to edit.

    Please Login or Register  to view this content.
    This one was a test to exclude the sheets automatically added when saving a file.

    Please Login or Register  to view this content.
    I tried to put this as a Activate on the sheet, but then, the matter is to navigate between sheets, as I seem to lack targets to aim at. I might be looking way too far for this, or lacking a different perspective...
    Last edited by eawyne; 01-31-2023 at 01:59 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,438

    Re: Hide any other sheet than the active one

    Try:

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: Hide any other sheet than the active one

    Hi @eawyne

    Try this example, to navigate throu worksheets,
    it has some code pieces in Thisworkbook module and in Main Sheet module.

    Every time you create a new sheet, it puts a hyperlink to Main sheet in cell A1.
    Every tima you activate Main sheet, it updates the list of worksheets

    To navigate, just clik on the cell with the sheet name you need to open
    Attached Files Attached Files
    Barriers are there for those who don't want to dream

  4. #4
    Registered User
    Join Date
    11-11-2021
    Location
    France
    MS-Off Ver
    2021
    Posts
    22

    Re: Hide any other sheet than the active one

    Thanks to both of you I will try both those solutions shortly - once I have time at work - but I still wanted to acknoweldge your help.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,438

    Re: Hide any other sheet than the active one

    You're welcome. Thanks for the rep.

  6. #6
    Registered User
    Join Date
    11-11-2021
    Location
    France
    MS-Off Ver
    2021
    Posts
    22

    Re: Hide any other sheet than the active one

    TMS
    I implemented your solution, which works perfectly fine Some sheets need additional code, and it's easy to integrate, so that's nifty. Despite my better understanding of VBA gained this past year (which is my first attemp at coding), I still lack the skills to come up with basic stuff like that, so your help is much appreciated.



    vichopalacios
    I kept your solution as well, as it could very well come in handy in another project ! So thanks to you as well.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,438

    Re: Hide any other sheet than the active one

    Again, you're welcome

+ 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. [SOLVED] Click to Hide / Unhide Column G of Active Sheet
    By BillySpivy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2022, 04:13 PM
  2. How to hide & unhide protect sheet when Protect Workbook is active
    By VisionSmart in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-19-2021, 06:50 AM
  3. [SOLVED] Hide columns on every sheet, Not just active sheet.
    By silentcarl in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-09-2015, 03:13 PM
  4. Macro to go back to the last active sheet and hide the active sheet
    By yatahaze in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2014, 08:18 AM
  5. [SOLVED] save active sheet in new workbook, naming it as cell value of active sheet
    By arkharova.s in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2014, 06:16 AM
  6. [SOLVED] Hide all but the active sheet
    By GavJ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2013, 12:02 AM
  7. Copy from active sheet and paste into new sheet using info from cell in active
    By Ingve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2006, 06:00 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