Private Sub btn_rechercher_Click()
Dim sel As Range, col As Long
Sheets("Suivi des lots").Select
On Error Resume Next 'éviter une erreur si "co = sel column" ne trouve pas la colonne
Set sel = Sheets("Suivi des lots").Range("C9:BT19").Find(Me.NumLotMatiere.Value, , xlValues, xlWhole)
col = sel.Column 'identifier la colonne correspondante au résultat de recherche
If sel Is Nothing Then
StatutLot.BackColor = RGB(255, 0, 0) '[/B]
Else
RefMatiere = Cells(6, col).Value ' [B]
DesignMatiere = Cells(7, col).Value '[/B]
With StatutLot
.BackColor = vbWhite 'On colore en blanc
'ci dessous on colore en fonction de ce qui est ou non trouvé
.BackColor = IIf(sel.Interior.ColorIndex = 50, &HC000&, _
IIf(sel.Interior.ColorIndex = 45, &H80FF&, &HFF&))
End With
End If
End Sub