Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [G6]) Is Nothing Or Target.Count > 1 Then Exit Sub
Dim Trouve As Boolean
Static Etat
If IsEmpty(Etat) Then
With Worksheets("2").[a3].CurrentRegion
Etat = .Offset(1, 0).Resize(.Rows.Count - 1, 7)
End With
End If
For i = 1 To UBound(Etat, 1)
If Etat(i, 4) = Target Then
Worksheets("2").Cells(i + 3, 6) = "OUI"
Worksheets("2").Cells(i + 3, 7) = Date
Trouve = True
Exit For
End If
Next i
If Trouve = False Then
MsgBox "Code Inexistant"
Worksheets("3").Cells(Worksheets("3").Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = Target
End If
End Sub