Re: Hiding Tabs

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



So this will look at a range of cells and show the worksheets based on
what values is in that range of cells? This seems a lot more complex
than your original solution and I really don't understand what it is
doing.


On Sep 16, 10:33 am, "Don Guillett" <dguille...@xxxxxxxxxxxxx> wrote:
You can restrict the range to just those cells desired.
You could use a select case for each of the tabs desired.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("a2:a8")) Is Nothing Then Exit Sub
On Error Resume Next
'hide all but menu
For Each sh In Sheets
  If sh.Name <> "Menu" Then sh.Visible = False
Next sh
'------
Select Case Target.Row
 Case 2: x = "sheet2"
 Case 3: x = "sheet3"
'etc
 Case Else
End Select

If UCase(Target) = "YES" Then Sheets(x).Visible = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguille...@xxxxxxxxxxxxx"newguy" <rexbi...@xxxxxxxxx> wrote in message

news:e12583bf-74fc-451e-8e70-996aadf00d46@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Sep 16, 9:26 am, "Don Guillett" <dguille...@xxxxxxxxxxxxx> wrote:



This is the correct place since you need a macro.
Right click *** tab>view code>insert this. Change $A$8 and *** name to
suit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$A$8" Then Exit Sub
If UCase(Target) = "YES" Then Sheets("sheet2").Visible = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguille...@xxxxxxxxxxxxx"newguy" <rexbi...@xxxxxxxxx> wrote in message

news:bc59cedd-3e1e-467d-a4c3-74b0100f7a5c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I am trying to find a way to hide or show tabs based answers from a
user on a menu page. So if the user answers "yes" to the first
question then tab 1 shows up if "no" tab 1 does not show up. Haven't
had a lot of experience with VBA thank you for your help.

2 Questions will the changes on what tabs show change as the user
inputs the answers to the questions?
And to duplicate this for other tabs I just need to copy the "If
statements" and change the Cell reference and tab name to suit?

Thank you

.


Quantcast