Hi MattRNR,
I have problem with suppressing the sheet not to be shown until the password is entered. Some conflict is appearing that is putting the code in the loop, hiding all sheets. :s
The best I can do is the code below. I know its not what you requested, but maybe can give you idea how to proceed.
Sorry could not help you.
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.ScreenUpdating = False
NumNam = ActiveSheet.Name
Num = ActiveSheet.Index
If NumNam = "Search" Then
For Each myWorksheet In Worksheets
myWorksheet.Visible = True
Next
End If
' The password for the diferent sheets are defined below
If NumNam = "Database" Then Pass = "Vesper" Else
If NumNam = "T1" Then Pass = "T1" Else
If NumNam = "T2" Then Pass = "T2" Else
If NumNam = "T3" Then Pass = "T3" Else
If NumNam <> "Search" Then
If Application.InputBox("Enter Password", "Password") <> Pass Then
MsgBox "Incorrect Password", vbCritical, "Error"
Application.EnableEvents = False
' If the password is incorrect, it poens "Search" sheet
Sheets("Search").Select
Application.EnableEvents = True
Else
End If
End If
Application.ScreenUpdating = True
End Sub
Bookmarks