+ Reply to Thread
Results 1 to 1 of 1

Macro Problem With Auto Hiding a Tab after Clicking on another tab

Hybrid View

  1. #1
    Registered User
    Join Date
    09-23-2013
    Location
    Louisville
    MS-Off Ver
    Excel 2010
    Posts
    4

    Macro Problem With Auto Hiding a Tab after Clicking on another tab

    Hello -

    Below I have the following code that is used to password protect tab named IR before anyone can view it. Additionally, I would like for tab IR to be hidden everytime tab SR is selected. My code that attempts to do that is in red but doesn't work.

    Can you please help



    Public PvSh As String
    Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    If Sh.Name = "IR" Then
    Num = ActiveWindow.Index
    Windows(Num).Visible = False
    If (InputBox("Password?") <> "1234") Then
    Windows(Num).Visible = True
    Sheets(PvSh).Select
    End If
    Windows(Num).Visible = True
    End If
    
    
    If Sh.Name = "SR" Then
    ActiveWorkbook.Sheets("IR").Visible = xlSheetVeryHidden
    End If
    End Sub
    
    Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
    PvSh = Sh.Name
    End Sub
    Moderator Note:

    Pls use code tags around your code as per forum rule#3.
    Last edited by Fotis1991; 09-25-2013 at 02:46 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 05-21-2010, 05:14 AM
  2. Macro - Hiding the Columns by Clicking on the Validation tab
    By suryaprasad in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-04-2008, 05:56 AM
  3. Problem clicking in cells
    By bosstone75 in forum Excel General
    Replies: 2
    Last Post: 05-13-2007, 09:41 PM
  4. Macro Auto Run Problem
    By Gary in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-26-2006, 02:55 AM
  5. Problem with clicking on cells
    By Gabriel B in forum Excel General
    Replies: 2
    Last Post: 01-11-2006, 07:50 PM

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