Closed Thread
Results 1 to 3 of 3

Hide sheets based content in different cells in main sheet

  1. #1
    Registered User
    Join Date
    MS-Off Ver

    Hide sheets based content in different cells in main sheet


    I've got an excel sheet with 5 sheets, sheet 1 acting as the main sheet. How to I hide sheets 2, 3, 4, and 5 based on a different cell in sheet 1 being YES / NO?

    This is what sheet 1 looks like in columns A and B respectively.

    Sheet2 NO
    Sheet3 NO
    Sheet4 NO
    Sheet5 NO

    Column B is a drop down using data validation and only valid values are YES / NO

    How can I automatically hide sheet2 if B1 is set to NO, sheet3 if B2 is set to NO, sheet4 if B3 is set to NO, sheet5 if B4 is set to NO?

    They should act all independently, so for example YES in B1 and B2 should display sheet2 and sheet3, but not sheet4 and sheet5 if B3 and B4 are set to NO.

    Appreciate your help. I tried a few examples I found on the internet, but no luck so far. I've only found examples where the range is always the same. Note I'm clueless when it comes to VBA code.


  2. #2
    Forum Guru
    Join Date
    London England
    MS-Off Ver
    MS 365 Office Suite.

    Re: Hide sheets based content in different cells in main sheet


    I would use three macros for this.

    The first two are sheet specific.

    Right Click On "Sheet1" At the Bottom Of Excel and Select View Code
    Paste this code in the module that opens and close it.

    Please Login or Register  to view this content.

    The main Macro needs to be pasted into a normal Macro Module

    Please Login or Register  to view this content.
    Attached Files Attached Files
    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.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel (Windows 11 64-bit)

    Re: Hide sheets based content in different cells in main sheet

    Administrative Note:

    Welcome to the forum.

    Unfortunately, this is a duplicate thread, and you are allowed only ONE thread per issue here.

    Please see Forum Rule #5 about thread duplication.

    I am closing this thread, but you may continue here in the original thread:

    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" to anyone who has offered you help in your thread. You can reward them by clicking on * Add Reputation below theur user name on the left, if you wish.

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 16
    Last Post: 12-06-2018, 12:34 PM
  2. Copy and transfer data from a Main sheet to two sheets based on two conditions
    By Joky in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 07-30-2017, 02:22 PM
  3. [SOLVED] Display data from sheets based on value in a cell on main sheet.. Help!
    By cpyter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-29-2014, 02:20 PM
  4. Pull data from multiple sheets based on cell in Main sheet
    By cpyter in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-29-2014, 01:19 PM
  5. [SOLVED] Copy content of cells from differe excel sheet to particular cells of a single main excel
    By laltoo2405 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-28-2014, 06:47 PM
  6. [SOLVED] Hide excel sheets but visible after clicking on hyperlink from main sheet.
    By naveen4pundir in forum Excel General
    Replies: 2
    Last Post: 03-29-2012, 02:16 AM


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