Closed Thread
Results 1 to 2 of 2

Hiding/unhiding sheets

  1. #1
    Registered User
    Join Date
    07-27-2010
    Location
    Portland
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question Hiding/unhiding sheets

    I am using this macro to hide/unhide sheets in my document that are linked to a table of contents type page. It was working fine until I tried to add a new sheet and hide/unhide it by the same method. I can't seem to get the "Entry Services" worksheet to either unhide or hide itself and I can't figure out where I went wrong. Can anyone help? I'm not super well versed in macros so the more simple you can make it, the better.

    Here's the macro I am using. I am using this code in my table of contents sheet. It works for every sheet except the entry services sheet.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim myPick As String

    myPick = Selection.Value
    Select Case myPick

    Case "CASAS Information"
    Application.ScreenUpdating = False
    Sheets("CASAS").Visible = True
    Sheets("Class Schedules").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("SLC").Visible = False
    Sheets("Directories").Visible = False
    Sheets("Pathways").Visible = False
    Sheets("Advising").Visible = False
    Sheets("ABE-GED").Visible = False
    Sheets("ESL").Visible = False
    Sheets("I-BEST").Visible = False
    Sheets("Registration").Visible = False
    Sheets("Student Services").Visible = False
    Sheets("Entry Services").Visible = False
    Application.ScreenUpdating = True
    Sheets("CASAS").Select

    Case "Employee/Staff Directories"
    Application.ScreenUpdating = False
    Sheets("Directories").Visible = True
    Sheets("Entry Services").Visible = False
    Sheets("Class Schedules").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("SLC").Visible = False
    Sheets("CASAS").Visible = False
    Sheets("Pathways").Visible = False
    Sheets("Advising").Visible = False
    Sheets("ABE-GED").Visible = False
    Sheets("ESL").Visible = False
    Sheets("I-BEST").Visible = False
    Sheets("Registration").Visible = False
    Sheets("Student Services").Visible = False
    Application.ScreenUpdating = True
    Sheets("Directories").Select

    Case "Pathways/WorkFirst"
    Application.ScreenUpdating = False
    Sheets("Pathways").Visible = True
    Sheets("Class Schedules").Visible = False
    Sheets("Entry Services").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("SLC").Visible = False
    Sheets("CASAS").Visible = False
    Sheets("Directories").Visible = False
    Sheets("Advising").Visible = False
    Sheets("ABE-GED").Visible = False
    Sheets("ESL").Visible = False
    Sheets("I-BEST").Visible = False
    Sheets("Registration").Visible = False
    Sheets("Student Services").Visible = False
    Application.ScreenUpdating = True
    Sheets("Pathways").Select

    Case "Advising"
    Application.ScreenUpdating = False
    Sheets("Advising").Visible = True
    Sheets("Class Schedules").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("Entry Services").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("SLC").Visible = False
    Sheets("CASAS").Visible = False
    Sheets("Directories").Visible = False
    Sheets("Pathways").Visible = False
    Sheets("ABE-GED").Visible = False
    Sheets("ESL").Visible = False
    Sheets("I-BEST").Visible = False
    Sheets("Registration").Visible = False
    Sheets("Student Services").Visible = False
    Application.ScreenUpdating = True
    Sheets("Advising").Select

    Case "ABE and GED Information"
    Application.ScreenUpdating = False
    Sheets("ABE-GED").Visible = True
    Sheets("Class Schedules").Visible = False
    Sheets("Entry Services").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("SLC").Visible = False
    Sheets("CASAS").Visible = False
    Sheets("Directories").Visible = False
    Sheets("Pathways").Visible = False
    Sheets("Advising").Visible = False
    Sheets("ESL").Visible = False
    Sheets("I-BEST").Visible = False
    Sheets("Registration").Visible = False
    Sheets("Student Services").Visible = False
    Application.ScreenUpdating = True
    Sheets("ABE-GED").Select

    Case "ESL Information"
    Application.ScreenUpdating = False
    Sheets("ESL").Visible = True
    Sheets("Class Schedules").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("Entry Services").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("SLC").Visible = False
    Sheets("CASAS").Visible = False
    Sheets("Directories").Visible = False
    Sheets("Pathways").Visible = False
    Sheets("Advising").Visible = False
    Sheets("ABE-GED").Visible = False
    Sheets("I-BEST").Visible = False
    Sheets("Registration").Visible = False
    Sheets("Student Services").Visible = False
    Sheets("Upcoming Events").Visible = False
    Application.ScreenUpdating = True
    Sheets("ESL").Select

    Case "I-BEST Program Information"
    Application.ScreenUpdating = False
    Sheets("I-BEST").Visible = True
    Sheets("Class Schedules").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("SLC").Visible = False
    Sheets("CASAS").Visible = False
    Sheets("Directories").Visible = False
    Sheets("Pathways").Visible = False
    Sheets("Advising").Visible = False
    Sheets("ABE-GED").Visible = False
    Sheets("ESL").Visible = False
    Sheets("Registration").Visible = False
    Sheets("Student Services").Visible = False
    Sheets("Upcoming Events").Visible = False
    Sheets("Entry Services").Visible = False
    Application.ScreenUpdating = True
    Sheets("I-BEST").Select

    Case "Registration/Testing"
    Application.ScreenUpdating = False
    Sheets("Registration").Visible = True
    Sheets("Class Schedules").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("SLC").Visible = False
    Sheets("CASAS").Visible = False
    Sheets("Directories").Visible = False
    Sheets("Pathways").Visible = False
    Sheets("Advising").Visible = False
    Sheets("ABE-GED").Visible = False
    Sheets("ESL").Visible = False
    Sheets("I-BEST").Visible = False
    Sheets("Student Services").Visible = False
    Sheets("Upcoming Events").Visible = False
    Sheets("Entry Services").Visible = False
    Application.ScreenUpdating = True
    Sheets("Registration").Select

    'Continues like this through middle section.. too long to post whole thing.

    Case "Student Learning Center"
    Application.ScreenUpdating = False
    Sheets("SLC").Visible = True
    Sheets("Class Schedules").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("I-BEST").Visible = False
    Sheets("CASAS").Visible = False
    Sheets("Directories").Visible = False
    Sheets("Pathways").Visible = False
    Sheets("Advising").Visible = False
    Sheets("ABE-GED").Visible = False
    Sheets("ESL").Visible = False
    Sheets("Registration").Visible = False
    Sheets("Student Services").Visible = False
    Sheets("Entry Services").Visible = False
    Sheets("Upcoming Events").Visible = False
    Application.ScreenUpdating = True
    Sheets("SLC").Select

    Case "Entry Services"
    Application.ScreenUpdating = False
    Sheets("Entry Services").Visible = True
    Sheets("SLC").Visible = False
    Sheets("Class Schedules").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("I-BEST").Visible = False
    Sheets("CASAS").Visible = False
    Sheets("Directories").Visible = False
    Sheets("Pathways").Visible = False
    Sheets("Advising").Visible = False
    Sheets("ABE-GED").Visible = False
    Sheets("ESL").Visible = False
    Sheets("Registration").Visible = False
    Sheets("Student Services").Visible = False
    Sheets("Upcoming Events").Visible = False
    Application.ScreenUpdating = True
    Sheets("Entry Services").Select

    Case Else
    Application.ScreenUpdating = False
    Sheets("ABE-GED").Visible = False
    Sheets("Class Schedules").Visible = False
    Sheets("Main Campus").Visible = False
    Sheets("TPC Staff Info").Visible = False
    Sheets("SLC").Visible = False
    Sheets("CASAS").Visible = False
    Sheets("Directories").Visible = False
    Sheets("Pathways").Visible = False
    Sheets("Advising").Visible = False
    Sheets("ESL").Visible = False
    Sheets("I-BEST").Visible = False
    Sheets("Registration").Visible = False
    Sheets("Student Services").Visible = False
    Application.ScreenUpdating = True
    Sheets("Index").Select
    Exit Sub
    End Select
    End Sub




    Thanks for the help!
    Nora

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Hiding/unhiding sheets

    Your post does not comply with Rule 5 of our Forum RULES. We have Seven question forums: Miscellaneous, General, Programming, Worksheet Functions, Charting, Excel 2007 Help and New Users. Please choose the appropriate forum, and post your question in ONLY one forum.
    Please familiarise yourself with the rules before posting. You can find them here.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1