Solenaja
Логическое выражение - либо True либо False.
Sub superprotect()
Dim PWORD As String, i As Integer, n As Integer
PWORD = "xxxxx"
n = ActiveWorkbook.Sheets.Count
For i = 2 To n
With Sheets(i)
.EnableSelection = xlUnlockedCells
.Visible = 2
.Protect Password:=PWORD, AllowFormattingRows:=True
End With
Next
Sheets(1).Protect Password:=PWORD, AllowFormattingRows:=True
Sheets(1).EnableSelection = xlUnlockedCells
With ActiveWindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayHeadings = False
End With
ActiveWorkbook.Protect PWORD, true, true
End Sub
Логическое выражение - либо True либо False.
Sub superprotect()
Dim PWORD As String, i As Integer, n As Integer
PWORD = "xxxxx"
n = ActiveWorkbook.Sheets.Count
For i = 2 To n
With Sheets(i)
.EnableSelection = xlUnlockedCells
.Visible = 2
.Protect Password:=PWORD, AllowFormattingRows:=True
End With
Next
Sheets(1).Protect Password:=PWORD, AllowFormattingRows:=True
Sheets(1).EnableSelection = xlUnlockedCells
With ActiveWindow
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayHeadings = False
End With
ActiveWorkbook.Protect PWORD, true, true
End Sub