Thanks
I placed the code in the userform and gives error- each sheet was protect with 'abc"
Code:
Runtime error 1004
The password you supplied is not correct.Verify that the CAPS LOCK
key is off and to be sure to use the correct capitalization
I protected each worksheet with "abc"
Code:
Private Sub UserForm_Activate()

    Dim wks As Worksheet
    For Each wks In ThisWorkbook.Worksheets
        wks.Unprotect "abc"
        wks.Protect UserInterfaceOnly:=True, Password:="abc"
    Next wks
    
End Sub