Bonjour,
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'Macros par Claude Dubois pour "lmylvc" Excel-Pratique le 02/06/10
Dim Lg%, x%
Lg = Range("d65536").End(xlUp).Row
If Not Application.Intersect(Target, Range("d4:d" & Lg)) Is Nothing Then
If Application.CountIf(Range("d:d"), Target) > 1 Then
x = Application.Match(Target, Range("d:d"), 0)
If x = Target.Row Then
x = Application.Match(Target, Range(Target.Offset(1, 0), Cells(Lg, 1)), 0) + Target.Row
End If
MsgBox ("DOUBLON !!!!!" & Chr(10) & "ligne " & x)
'Cells(x, 1).Select
Target.ClearContents
Exit Sub
Else
MsgBox ("L'EAN bippé n'est pas présent dans la base de données !")
End If
End If
End Sub
Par contre ta deuxième demande était déjà présent dans ton code