' Sur clic cellules B4:B29
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
On Error GoTo Fin
If Target.Count > 1 Then Exit Sub
If Left(ActiveSheet.Name, 1) = "S" Then
If Not Intersect(Target, [B4:B29]) Is Nothing Then
ActiveSheet.Unprotect
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=Liste"
.ShowInput = True
.ShowError = True
End With
ActiveSheet.Protect
End If
End If
Fin:
End Sub
' Sur validation
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Left(ActiveSheet.Name, 1) = "S" Then
If Not Intersect(Target, [B4:B29]) Is Nothing Then
ActiveSheet.Unprotect
Application.EnableEvents = False
On Error Resume Next
Target = Split(Target, " - ")(1)
ActiveSheet.Protect
End If
Application.EnableEvents = True
End If
End Sub