Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target = "" Then Exit Sub
If Target.Value Like "*/*" = False Then
MsgBox "Code Barre Incorrect", vbExclamation, "ANNULATION"
Application.EnableEvents = False
Target = "": Target.Select
Application.EnableEvents = True
Exit Sub
End If
ref = Split(Target, "/")(0): lot = Split(Target, "/")(1)
If Intersect(Range(Target.Address), Range("K6,N6")) Is Nothing Then Exit Sub
If Target.Address = "$K$6" Then lda = "B10": col = 8
If Target.Address = "$N$6" Then lda = "H10": col = 9
lig = Application.Match(ref, [A:A], 0)
If Not IsNumeric(lig) Then MsgBox "inexistant": Exit Sub
Application.EnableEvents = False
Range(lda) = Date: Beep
Cells(lig, 7) = lot: Cells(lig, col) = Cells(lig, col) + 1: Target = ""
Target.Select
Application.EnableEvents = True
End Sub