Hiding sheets based on cell value

leopalmer

New Member
Joined
Feb 4, 2014
Messages
2
I have a 2 sheet workbook that is going to be a form for usrers to fill in and send back to me for action to be taken.
What I am trying to achieve is when someone selects Add from a dropdown in cell K19 then only the Add sheet is visible or when they select Amend only the Amend sheet is visible, I do want them to be able to change their mind if they select the wrong option to start with.
I have posted this problem and a copy of the workbook in another forum but can't seem to get anywhere. the workbook is avauilable from
.excelforum.com/excel-programming-vba-macros/982422-hiding-sheets.html#post3564014
Hiding sheets
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Paste this into each sheet object:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)


Application.EnableEvents = False


    If Not Intersect(Target, Range("K19")) Is Nothing Then
        Select Case Target.Value
            Case "Add"
                Worksheets("Add").Visible = xlSheetVisible
                Worksheets("Amend").Visible = xlSheetHidden
                Worksheets("Add").Range("K19").Value = "Add"
            Case "Amend"
                Worksheets("Amend").Visible = xlSheetVisible
                Worksheets("Add").Visible = xlSheetHidden
                Worksheets("Amend").Range("K19").Value = "Amend"
        End Select
    End If
    
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top