+ Reply to Thread
Results 1 to 5 of 5

hide & unhide multiple sheets based on cell value

  1. #1
    Forum Contributor
    Join Date
    06-17-2021
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    219

    hide & unhide multiple sheets based on cell value

    hi experts
    my real file contains sheets are about 50 sheets, but I attach simple file contains two sheets to understand my idea. so what i want when write the value in B2 in sheet MAIN should match for all hidden sheets with cell M28 if it's match for one of them then should show that's sheet which contain right value if not then stay hidden and if I select another sheet to search for
    it . it should hidden the sheet has ever searched whether when search for a new sheet if the value is matched or not .
    thanks .
    Attached Files Attached Files

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

    Re: hide & unhide multiple sheets based on cell value

    Put this code into the module for worksheet main. Do not use the code you have in Module1.
    Please Login or Register  to view this content.
    Also, I strongly recommend to everyone that they use Option Explicit and declare variables. Doing so prevents a lot of bugs and runtime errors.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    06-17-2021
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    219

    Re: hide & unhide multiple sheets based on cell value

    thanks . but I would understand this Me.Name what means especially Me ,please?

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

    Re: hide & unhide multiple sheets based on cell value

    Whenever you use Me it refers to the object that owns the code module. In this case it is the worksheet. So Me.Name = "main". We use Me.Name so that if someone changes the name of the worksheet on the tab, the code will not have to be changed.

  5. #5
    Forum Contributor
    Join Date
    06-17-2021
    Location
    Asia
    MS-Off Ver
    2019
    Posts
    219

    Re: hide & unhide multiple sheets based on cell value

    n this case it is the worksheet. So Me.Name = "main".
    I suspect that , but I was needing confirmation from you.
    thanks so much for your solution .

+ 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. Based on cell value sheets to be hide/unhide
    By rajuganapathy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2019, 03:06 PM
  2. Replies: 0
    Last Post: 04-18-2019, 09:18 AM
  3. [SOLVED] Hide / Unhide sheets based on cell value
    By rajeshn_in in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2017, 11:35 AM
  4. Hide or unhide rows based on value across multiple sheets
    By Casper99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-26-2016, 08:23 PM
  5. Hide & Unhide Multiple Sheets based on different cell values
    By kspeese in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2016, 02:46 AM
  6. HIDE/UNHIDE Rows based on cell value in multiple sheets.
    By yatin1964 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2015, 12:29 AM
  7. hide and unhide sheets based on a cell value
    By ccsmith in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2014, 07:25 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