What is the best way to go about adding an input box to the below code that would prompt for a password, notify if password is wrong, and close input box without completing if incorrect?
Private Sub CommandButton6_Click()
Workbooks("Budget Template - Working 8.7").Protect "test123"
Dim ws As Worksheet
For Each ws In Worksheets
ws.Protect "password"
Next ws
End Sub
Private Sub CommandButton7_Click()
Workbooks("Budget Template - Working 8.7").Unprotect "test123"
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect "password"
Next ws
End Sub
Private Sub CommandButton6_Click()
Workbooks("Budget Template - Working 8.7").Protect "test123"
Dim ws As Worksheet
For Each ws In Worksheets
ws.Protect "password"
Next ws
End Sub
Private Sub CommandButton7_Click()
Workbooks("Budget Template - Working 8.7").Unprotect "test123"
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect "password"
Next ws
End Sub