Hi
Thanks for your reply,
I have some code that i found somewhere else but can't get it to work. I would rather have a password for each worksheet than hiding them or creating forms. Here is what i have.
Public PvSh As String
Public Pwd As String
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Pwd = "" Then
If Sh.NAME = "Sheet1" Then
hello
End If
If Sh.NAME = "Sheet3" Then
hello2
End If
End If
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
PvSh = Sh.NAME
End Sub
Sub SJ()
Num = ActiveWindow.Index
Windows(Num).Visible = False
If Application.InputBox("Enter Password", "Password") <> "airplane" Then
MsgBox "Incorrect Password", vbCritical, "Error"
Application.EnableEvents = False
Sheets(PvSh).Select
Application.EnableEvents = True
Else
Pwd = "airplane"
End If
Windows(Num).Visible = True
End Sub
Cheers
Andy
Bookmarks