VBA: Use password to go to sheet
Solved/Closed
Andy.top
Posts
1
Registration date
Saturday 19 June 2021
Status
Member
Last seen
19 June 2021
-
19 Jun 2021 à 07:01
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 21 Jun 2021 à 12:10
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 21 Jun 2021 à 12:10
Related:
- VBA: Use password to go to sheet
- Vba find - Guide
- Vba case like - Guide
- Vba timer - Guide
- Create new sheet vba - Guide
- Vba userform - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
21 Jun 2021 à 12:10
21 Jun 2021 à 12:10
Hi Andy,
You end your code by going to the sheet, so you will always get there. Try placing 'Sheets("Bank Account").Select' before before 'Case Else'.
Or use the code below
I don't see anything about unprotecting the sheet, but I guess you'll add that later.
Best regards,
Trowa
You end your code by going to the sheet, so you will always get there. Try placing 'Sheets("Bank Account").Select' before before 'Case Else'.
Or use the code below
Private Sub CommandButton8_Click()
Dim mPW As String
mPW = InputBox("Enter Password", "Password Protected")
If mPW = "Shewasadragon" Then
Sheets("Bank Account").Select
Else
MsgBox "Incorrect Password"
End If
End Sub
I don't see anything about unprotecting the sheet, but I guess you'll add that later.
Best regards,
Trowa