1: 2: 3: 4: 5: 6: 7: 8:
Private Sub Workbook_Open() Dim ws As Worksheet Dim MyPassword As String MyPassword = "abc" For Each ws In ActiveWorkbook.Worksheets ws.Protect Password:=MyPassword, UserInterfaceOnly:=True, Contents:=True Next End Sub