Posts by Kent_e

    Re: Unhide Sheet Based On Cell Value Contents


    Bryce,


    Your hide code works perfectly for what I needed, I made a minor change so it is a YES/NO question basically and it worked well.


    I want to add a second set of logic applying to anther cell how do I do put this into the VBA. I tried adding a second copy of the code with a different Range Cell but it didn't work after I did that.


    Sorry for the rookie question I have zero VBA experience. likely I made a foolish error.


    Cheers
    Kent





    Private Sub worksheet_change(ByVal target As Excel.Range)
    Select Case Worksheets("D").Range("A1").Value
    Case "YES"
    Worksheets("A").Visible = True
    Worksheets("B").Visible = False
    Worksheets("C").Visible = False
    Case ""
    Worksheets("B").Visible = False
    Worksheets("A").Visible = False
    Worksheets("C").Visible = False


    End Select
    End Sub


    Private Sub worksheet_change(ByVal target As Excel.Range)
    Select Case Worksheets("D").Range("B1").Value
    Case "YES"
    Worksheets("A").Visible = False
    Worksheets("B").Visible = True
    Worksheets("C").Visible = False
    Case ""
    Worksheets("B").Visible = False
    Worksheets("A").Visible = False
    Worksheets("C").Visible = False


    End Select
    End Sub