vba hide tab according to cell value

I have 10 tabs each with a different manager's name.  My first sheet will serve sort of as a navigation sheet if you will.  Once they select their name on the navigation sheet I need a macro to hide all sheets whose name does not contain the manger name that was chosen.  I could proceed on my own but how do you search a sheet name for a certain name?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rob HensonFinance AnalystCommented:
See similar example attached.

All sheets start off hidden until sheet name selected on first sheet.

Use the Format Sheet menu to unhide the sheets, change the names and the references on sheet 1 will also change. The rehide the sheets.

This uses the hyperlink method but the hyperlink requires the destination to be unhidden. The hyperlink goes to the same cell as the hyperlink but there is code on the sheet that recognises the hyperlink selection event and unhides and activates the relavant sheet.

Rob H


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ardhendu SarangiSr. Project ManagerCommented:
Can you try the following code -

I have taken an example of two managers - John and Jane in this case.


Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim cel As Range, targ As Range
    Dim i As Integer
    Set targ = [F6]    'Watch these cells for changes
    Set targ = Intersect(targ, Target)
    If targ Is Nothing Then Exit Sub

    Application.ScreenUpdating = False
    Application.EnableEvents = False
    For i = 1 To Worksheets.Count
        If Worksheets(i).Name = targ.Value Or Worksheets(i).Name = "Summary" Then
            Worksheets(i).Visible = True
            Worksheets(i).Visible = False
        End If
    Application.ScreenUpdating = True
    Application.EnableEvents = True
    MsgBox ("Done!")
End Sub

Open in new window

Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.