В модуль листа. Пароль на лист - 12345
Скрытый текст |
---|
Код |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | Private Sub Worksheet_Change( ByVal Target As Range)
If Target.Count = 1 Then
If Target.Column = 28 Then
If Target.Row = 28 Or (Target.Row - 28) Mod 30 = 0 Then
Dim protRng As Range
Set protRng = Range(Cells(Target.Offset(-27).Row, 16), Cells(Target.Offset(1).Row, 38))
With protRng
If Target.Value = "да" Then
Me .Unprotect "12345"
.Locked = True
.FormulaHidden = True
Me .Protect "12345" , True , True , True , True
Else
Me .Unprotect "12345"
.Locked = False
.FormulaHidden = False
Me .Protect "12345" , True , True , True , True
End If
. Select
End With
End If
End If
End If
End Sub
|
|
|