Option Base 1
Function RechercheCode(NRef, ListeRef As Range, Matrice As Range)
On Error GoTo Fin
Dim Lig As Integer, Col As Integer, IndexLig As Byte
Lig = Cells(Matrice.Rows.Count, 1).End(xlUp).Row
Col = Matrice.Columns.Count
IndexLig = 0
For i = 1 To Col
Set Plage = Range(Matrice.Cells(1, i), Matrice.Cells(Lig, i))
If Not IsError(Application.Match(NRef, Plage, 0)) Then
IndexLig = Application.Match(NRef, Plage, 0)
End If
Next i
If IndexLig = 0 Then
RechercheCode = "Non"
Else
RechercheCode = ListeRef.Cells(IndexLig, 1)
End If
Fin:
End Function