[COLOR="DarkSlateGray"][B][COLOR="SeaGreen"]'Code de la feuille "Feuil1a" :[/COLOR]
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cod_V As Object, oCel As Range, oCod As Range, tmp
10 If Not Intersect(Target, Range(Rows(2), Rows(Rows.Count)), Columns(2)) Is Nothing Then
Application.EnableEvents = False
On Error GoTo E
40 With Sheets("Feuil2")
50 Set cod_V = .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
End With
70 With Intersect(Target, Range(Rows(2), Rows(Rows.Count)), Columns(2))
80 .Offset(0, 1).Value = Empty
For Each oCel In .Cells
If Not IsEmpty(oCel) Then
tmp = WorksheetFunction.Substitute(oCel.Value, " ", "")
For Each oCod In cod_V.Cells
If tmp = WorksheetFunction.Substitute(oCod.Value, " ", "") Then
140 oCel.Offset(0, 1).Value = oCod.Offset(0, 7).Value
End If
Next oCod
End If
Next oCel
End With
R: On Error GoTo 0
Application.EnableEvents = True
End If
Exit Sub
E: MsgBox "Une erreur imprévue s'est produite."
Resume R
End Sub
[COLOR="SeaGreen"]'Si vous modifiez les plages de lecture et d'écriture des données,
'adaptez les lignes 10, 40, 50, 80, 140.[/COLOR][/B][/COLOR]