Sub Worksheet_Activate()
Dim Lot$, Nlig%, DL%, DC%, L%, C%, Ligne%, T, Nom
Application.ScreenUpdating = False
Lot = "Lot_" & Right(Lot, 2)
Nlig = 5
With Sheets("Matrice d'écart")
DL = .Cells(Cells.Rows.Count, "A").End(xlUp).Row
DC = .Cells(1, Columns.Count).End(xlToLeft).Column
Tablo = .Range(.Cells(1, "BC"), .Cells(DL, DC))
Nom = .Range(.Cells(1, 1), .Cells(DL, 1))
End With
While Cells(Nlig, "A") <> ""
Lot = Right(Cells(Nlig, "A"), 2)
For C = 1 To UBound(Tablo, 2)
For L = 2 To UBound(Tablo)
If Right(Tablo(L, C), 2) = Lot Then
Cells(Nlig, "B") = Nom(L, 1)
Exit For
End If
Next L
Next C
Nlig = Nlig + 1
Wend
End Sub