+ Reply to Thread
Results 1 to 5 of 5

Hide Sheet when Changing Sheet

  1. #1
    Forum Contributor
    Join Date
    09-12-2015
    Location
    Okinawa, Japan
    MS-Off Ver
    2013
    Posts
    178

    Hide Sheet when Changing Sheet

    Crazy request here. Is there VBA code that will hide a sheet when it is deselected? Ex: I am on sheet2, I click the tab to change to sheet1 and sheet2 hides itself.

    I will assume this goes into the specific sheet module.

    Your help is appreciated.

  2. #2
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Hide Sheet when Changing Sheet

    At a really basic level, the Workbook_SheetDeactivate event could handle this. The only issue, is that eventually you get down to just one worksheet. Even if you unhide one of the sheets that get hidden due to this macro, it immediately hides the sheet that was visible. Maybe that's ok?
    Please Login or Register  to view this content.
    This code would go into the ThisWorkbook module in the VB Editor.

  3. #3
    Forum Contributor
    Join Date
    09-12-2015
    Location
    Okinawa, Japan
    MS-Off Ver
    2013
    Posts
    178

    Re: Hide Sheet when Changing Sheet

    Hey, thank you for the reply. What would the code look like for a single sheet("Sheet2") and not the entire workbook? I only want that sheet to be hidden after deselection.
    Thank you,
    Ken

  4. #4
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Hide Sheet when Changing Sheet

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-12-2015
    Location
    Okinawa, Japan
    MS-Off Ver
    2013
    Posts
    178

    Re: Hide Sheet when Changing Sheet

    Very cool, thank you.

+ 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 or Unhide Rows on one sheet based on value entered in cell on another sheet
    By wfsteadman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2016, 07:30 PM
  2. Changing Cell Color in Summary sheet from the sheet that Changes that sheet
    By rwhitlock11 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2016, 11:51 AM
  3. VBA Code to find range from Input sheet and hide respective columns in sheet 2.
    By skonduru in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2016, 11:56 AM
  4. Hide Rows on one Sheet based on cells in another sheet being empty
    By KDF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2013, 01:48 PM
  5. Replies: 4
    Last Post: 07-24-2012, 07:09 AM
  6. unhide sheet, copy data, hide sheet - screenupdate = false
    By titus.hanke in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2008, 02:46 PM
  7. Replies: 8
    Last Post: 06-09-2006, 07:45 AM

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