+ Reply to Thread
Results 1 to 7 of 7

Need automatic macro that makes 4 sheets disappear if a sheet outside of those 4 is select

  1. #1
    Forum Contributor
    Join Date
    08-03-2005
    Posts
    269

    Need automatic macro that makes 4 sheets disappear if a sheet outside of those 4 is select

    Hi all..

    I have done this before with one sheet, where I use the deactivate command in the code for that sheet, if that sheet is deselected then it disappears...

    Please Login or Register  to view this content.
    What I want to know know, is if I select a sheet other than sheet1, sheet2, sheet3 and sheet4, than those 4 all become hidden.

    Thanks,
    Last edited by caliskier; 05-18-2016 at 12:23 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,758

    Re: Need automatic macro that makes 4 sheets disappear if a sheet outside of those 4 is se

    Try this code in the ThisWorkbook module. Update with your actual sheet names for the four sheets you want to hide. (I'm assuming by "disappear" you mean "hide" and not "delete".)

    Please Login or Register  to view this content.
    How do you make them reappear?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,545

    Re: Need automatic macro that makes 4 sheets disappear if a sheet outside of those 4 is se

    Or
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Need automatic macro that makes 4 sheets disappear if a sheet outside of those 4 is se

    This is a workbook Macro.

    This needs to be posted in a specific part of the workbook.

    Select Developer and then visual basic

    Select View and then Project Explorer

    In the List that opens, find your project and double click on "This Workbook"

    Paste this macro in the module that opens.

    NB: I have written the macro so it is easy to expand and update.

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  5. #5
    Forum Contributor
    Join Date
    08-03-2005
    Posts
    269

    Re: Need automatic macro that makes 4 sheets disappear if a sheet outside of those 4 is se

    Quote Originally Posted by 6StringJazzer View Post
    Try this code in the ThisWorkbook module. Update with your actual sheet names for the four sheets you want to hide. (I'm assuming by "disappear" you mean "hide" and not "delete".)

    Please Login or Register  to view this content.
    How do you make them reappear?

    perfect... I have a button on another sheet that makes them appear. The other sheet is a form, I don't like overwhelming folks with a bunch of sheets, only appear when you need them, go away when you don't.

    Thanks so much!!

  6. #6
    Forum Contributor
    Join Date
    08-03-2005
    Posts
    269

    Re: Need automatic macro that makes 4 sheets disappear if a sheet outside of those 4 is se

    Quote Originally Posted by mehmetcik View Post
    This is a workbook Macro.

    This needs to be posted in a specific part of the workbook.

    Select Developer and then visual basic

    Select View and then Project Explorer

    In the List that opens, find your project and double click on "This Workbook"

    Paste this macro in the module that opens.

    NB: I have written the macro so it is easy to expand and update.

    Please Login or Register  to view this content.
    Just saw yours after solved, thanks to you to, might come back if I expand on my sheets

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,545

    Re: Need automatic macro that makes 4 sheets disappear if a sheet outside of those 4 is se

    I know your case is solved but as I was playing with Select Case, here it is.
    Forget about my previous post (which you probably did already). I should read the requirements better.
    This seems to work also. Easy to add to or delete from also.
    Please Login or Register  to view this content.

+ 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. A maco makes all my Vlookups and formulas disappear!!!!
    By marvinabou7890 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-11-2016, 08:20 PM
  2. Workbook.Save makes Userform Disappear
    By Antenne88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2015, 06:30 PM
  3. Group - Makes my rows disappear
    By spookiepower in forum Excel General
    Replies: 3
    Last Post: 07-30-2013, 05:06 PM
  4. MouseOver cell that makes apear and disappear an image
    By blakito in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2012, 12:57 PM
  5. MouseOver cell that makes apear and disappear an image
    By first_mo_za in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-20-2012, 03:37 AM
  6. Why does #DIV/O appear? Retyping the figures makes it disappear!!
    By HAYLEYFARMINER in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-28-2008, 09:20 AM
  7. Insert-Subtotals makes Column Outlines disappear
    By gpie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-22-2005, 12:10 PM

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