Results 1 to 20 of 20

Worksheet_Activate Not Firing

Threaded View

  1. #1
    Registered User
    Join Date
    07-31-2009
    Location
    Gilbert, Az
    MS-Off Ver
    Excel 2007
    Posts
    30

    Worksheet_Activate Not Firing

    I have a workbook that contains several worksheets. One particular worksheet is a main page with buttons that open up the other worksheets for the user to view specific data. To minimize the open worksheets I have tried to institute a worksheet activate so that when the user selects this main page tab all other worksheets hide. It works well, for most of the sheets. However, for some reason a few sheets will not hide. Ive tried several different codes to get these particular sheets to close to no avail. Ive tried calling each sheet individually to hide the sheet, and Ive tried to hide all sheets together. Codes Ive used are below. Again, both codes work fine but only on some sheets. How can I get the Activate call to work for all sheets? Anyone ever have this issue? The particular sheets Im having a hard time with are in red in 2nd code.

    Codes Ive used:
    Private Sub Worksheet_Activate()
    'Closes all open sheets and goes back to main menu
               
        Dim sh As Worksheet
        
        For Each sh In ThisWorkbook.Worksheets
           If Not sh.Name = "Reports" Then sh.Visible = False
       Next sh
    End Sub
    And:
    Private Sub Worksheet_Activate()
        Sheets("Pivot32nd_Hr_By Model").Visible = False
        Sheets("Chart32nd_Hr_By Model").Visible = False
        Sheets("PivotMontlyWearVsBilledWear").Visible = False
        Sheets("ChartMonthlyWearvsBilledWear").Visible = False
        Sheets("PivotCostByBrand").Visible = False
        Sheets("ChartCostByBrand").Visible = False
        Sheets("PivotCostByModel").Visible = False
        Sheets("ChartCostByModel").Visible = False
        Sheets("Data50%Below").Visible = False
        Sheets("Pivot50%Below").Visible = False
        Sheets("Chart50%Below").Visible = False
        Sheets("DataFleet%Tread").Visible = False
        Sheets("PivotFleet%Tread").Visible = False
        Sheets("ChartFleet%Tread").Visible = False
        Sheets("PivotCustomerWear_Hr").Visible = False
        Sheets("ChartCustomerWear_Hr").Visible = False
    Last edited by dthhal; 02-10-2010 at 04:48 PM. Reason: Code

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