View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nad Nad is offline
external usenet poster
 
Posts: 20
Default Protecting Sheet

Hi
I used this code to protect my sheet
Private Sub Worksheet_Activate()
psw = InputBox("Please insert password to view data.", "Password Checker")
If psw = "EPM" Then
Sheets("ABD").Select
Else
MsgBox "Incorrect Password"
End If
End Sub
But, even if i insert the wrong password my sheet become visible/active.
Pls tell me where i am wrong.
Thanks