Hi all I have a workbook that I need to share out to my wife and there are a couple of command buttons that once clicked would enable her to be able to view the coding ect of the WB as well as the ribbon and tabs ect.
The code shown below using a inputbox, prompts for a password to be entered if the button is clicked BUT if the password is wrong once OK is clicked or Cancel is selected then the inputbox closes and the code runs anyway.
Would someone let me know what I need to add to react to a wrong password entry and also to the cancel button.
The code shown below using a inputbox, prompts for a password to be entered if the button is clicked BUT if the password is wrong once OK is clicked or Cancel is selected then the inputbox closes and the code runs anyway.
Would someone let me know what I need to add to react to a wrong password entry and also to the cancel button.
VBA Code:
Private Sub cmbEditWB_Click()
Dim 123 As String
123 = InputBox("Please Enter Password to Access Controls")
If ans <> "123" Then
Call EditWB
End If
End Sub