View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
HL HL is offline
external usenet poster
 
Posts: 8
Default Hiding worksheets based on user selection

JW, Thanks for the code. I was able to get it to work. I do have another
questinon. If the user changes his/her answer (example, answer was yes, now
the cell is blank) how do you get the worksheets to be visible again.

"JNW" wrote:

This requires programming. No formula can do this.

It is not too difficult.

-Press Alt+F11 to open the VBA window
-If you don't see a file tree on the left press Ctrl+R
-Double click on the sheet where your drop down menus are
-Place the copy and paste the following code into the window:

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("B2").value = "Yes" then
Sheets("Process B").visible = false
Sheets("Process C").visible = false
Sheets("Process D").visible = false
ElseIf Range("B2").value = "No" then
Sheets("Process B").visible = true
Sheets("Process C").visible = true
Sheets("Process D").visible = true
End if
End Sub


Note that I've assumed that your drop down for the first question is in cell
B2. You can change that easy enough. I've also assumed that you've named
your sheets Process B, etc. If you need to change them make sure you keep
the name inside quotation marks.

Without more information it's hard to get this perfect for your needs, but
hopefully it gets you started.
--
JNW


"HL" wrote:

Hello,

I have created an Excell spreadsheet with 5 sheets. The tabs are called:
Introduction (sheet 1), Process A(sheet 2), Process B(sheet3), Process
C(sheet 4), & Process D (sheet 5).

For the Introduction sheet, I have four questions that can be answered Yes
or No. By the way, I am using a drop-down menu for the Yes/No response.

How can I hide specific sheets if the user answers yes to a question? For
example: If the user answer yes to the first question, then I would like to
hide sheets 3-5?

Thanks.