Environ("UserName")
Sub pswdProt()
Dim pswd As String
pswd = Inputbox("Enter password", "Password", "?????")
If pswd <> "yourpassword" Then
MsgBox "Incorrect Password"
Exit Sub
Else
End If
'Put your code here
End Sub
Sub pswdProt()
Dim pswd As String
pswd = Inputbox("Enter password", "Password", "?????")
If pswd <> "yourpassword" Then
MsgBox "Incorrect Password, Macro disabled"
Application.EnableEvents = False
Exit Sub
Else
Application.EnableEvents = True
End If
'Put your code here
End Sub
Private Sub Workbook_Open()
Dim pswd As String
pswd = InputBox("Enter password", "Password", "?????")
If pswd <> "swami" Then
MsgBox "Incorrect Password, Macro disabled"
Application.EnableEvents = False
Exit Sub
Else
Application.EnableEvents = True
End If
'Force the current selection to be selected, triggering the appropriate
'state of the cut, copy & paste commands
Call ChkSelection(ActiveSheet)
ThisWorkbook.Application.CellDragAndDrop = False
End Sub