Pavertheway
New Member
- Joined
- Nov 5, 2018
- Messages
- 47
Hi,
I currently use the following code to lock a sheet in a Workbook:
When the password is entered incorrectly, I would like to add a simple message stating "Password entered incorrectly" - how would I do this?
Thanks as always.
I currently use the following code to lock a sheet in a Workbook:
Code:
mysheet = "Sheet1"If ActiveSheet.Name = mysheet Then
ActiveSheet.Visible = False
Response = InputBox("Enter password to view sheet")
If Response = "Sheet1" Then
Sheets(mysheet).Visible = True
Application.EnableEvents = False
Sheets(mysheet).Select
Application.EnableEvents = True
End If
End If
Sheets(mysheet).Visible = True
When the password is entered incorrectly, I would like to add a simple message stating "Password entered incorrectly" - how would I do this?
Thanks as always.