Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim M$, i&, r&
Dim x As Range
t = 0.2 '----- définition de la dérive acceptable. Modifiable bien entendue
For i = 13 To 22
M = Cells(i, 1)
Set x = Range("A1:A6").Find(M, , xlValues, xlWhole, , , False)
If Not x Is Nothing Then
r = x.Row
Select Case CDbl(Application.WorksheetFunction.Substitute(Cells(i, 2), ".", ","))
Case Is > CDbl(Application.WorksheetFunction.Substitute(Cells(r, 2), ".", ",")) * (1 + t)
Cells(i, 4) = "Dérive supérieure à la fourchette acceptée"
Case Is < CDbl(Application.WorksheetFunction.Substitute(Cells(r, 2), ".", ",")) * (1 - t)
Cells(i, 4) = "Dérive inférieure à la fourchette acceptée"
Case Else
Cells(i, 4) = "Dans la fourchette acceptable"
End Select
End If
Next i
End Sub