+ Reply to Thread
Results 1 to 5 of 5

Hide / unhide sheets when a condition is met

Hybrid View

  1. #1
    Registered User
    Join Date
    04-26-2016
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    3

    Hide / unhide sheets when a condition is met

    Hello!

    I have a problem finding a macro or a way to hide/unhide worksheets.

    I searched on Google and found this that almost work:

    (Found here on Ozgrid: http://www.ozgrid.com/forum/showthread.php?t=59178)


    Private Sub worksheet_change(ByVal target As Excel.Range)
    Select Case Worksheets("Calc").Range("A1").Value
    Case "A"
    Worksheets("Results1").Visible = True
    Worksheets("Results2").Visible = False
    Worksheets("Results3").Visible = False
    Case "B"
    Worksheets("Rresults2").Visible = True
    Worksheets("Results1").Visible = False
    Worksheets("Results3").Visible = False
    Case "C"
    Worksheets("Results3").Visible = True
    Worksheets("Results2").Visible = False
    Worksheets("Results1").Visible = False
    End Select
    End Sub


    The this is that if I write "A" "B" or "C" in cell A1, it works.

    However, I want to use the result of a formula in the cell (ex.: a IF formula that gives A or B as an answer), which doeasn't work.

    Is it possible to make it happen?
    Last edited by Kain_; 04-26-2016 at 03:49 PM.

  2. #2
    Forum Contributor
    Join Date
    09-03-2015
    Location
    IE
    MS-Off Ver
    2003 - 2016
    Posts
    258

    Re: Hide / unhide sheets when a condition is met

    Also posted on OzGrid

  3. #3
    Registered User
    Join Date
    04-26-2016
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Hide / unhide sheets when a condition is met

    Yeah, I found this part on this site.

    But I can't manage to make if work without a manual action.

    So is it possible to "trigger" the hide / unhide with a formula result?

  4. #4
    Forum Contributor
    Join Date
    09-03-2015
    Location
    IE
    MS-Off Ver
    2003 - 2016
    Posts
    258

    Re: Hide / unhide sheets when a condition is met

    Please have a read of the board rules, #8 in particular.

  5. #5
    Registered User
    Join Date
    04-26-2016
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Hide / unhide sheets when a condition is met

    Thanks, I edited my post for proper reference.

+ 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 all sheets (very hidden) except one or Unhide all sheets with password
    By wmdriver in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2015, 07:21 AM
  2. Hide and Unhide sheets
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2014, 12:50 PM
  3. [SOLVED] VBA to UnHide/Hide Sheets
    By maryren in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-20-2014, 05:01 PM
  4. How to Hide/Unhide rows based on condition
    By Kfir7 in forum Excel General
    Replies: 33
    Last Post: 01-07-2013, 12:55 PM
  5. [SOLVED] Hide or unhide sheets
    By Jakes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2012, 02:09 AM
  6. Hide/Unhide Sheets
    By Runner77 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2006, 05:25 AM
  7. Code to hide and unhide columns, with certain condition?
    By Frederic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2005, 12:05 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