VBA: Use password to go to sheet
Solved/Closed
Andy.top
TrowaD
- Posts
- 1
- Registration date
- Saturday June 19, 2021
- Status
- Member
- Last seen
- June 19, 2021
TrowaD
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Related:
- VBA: Use password to go to sheet
- Vba code to compare two excel sheets and copy differences ✓ - Forum - Excel
- Vba code to compare two excel sheets and highlight differences ✓ - Forum - Excel
- Macro to compare 2 sheets and copy differences ✓ - Forum - Excel
- How to compare two Excel sheets with varying data ✓ - Forum - Excel
- VBA Compare 2 sheets and output difference to 3rd sheet - Forum - Excel
1 reply
TrowaD
Jun 21, 2021 at 12:10 PM
- Posts
- 2886
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- June 27, 2022
Jun 21, 2021 at 12:10 PM
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