1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Sub essai()
Dim test As Boolean
test = True
For i = 2 To Range("A65536").End(xlUp).Row
For j = i + 1 To Range("A65536").End(xlUp).Row
If Abs(Cells(i, 1) - Cells(j, 1)) = 1.5 Then
'Cells(i, 5) = Cells(i, 1)
'Cells(j, 5) = Cells(j, 1) 'je m'étais planté ici désolé
If Columns("E").Find(Cells(i, 1), LookIn:=xlValues) Is Nothing Then Cells(Rows.Count, "E").End(xlUp).Offset(1, 0) = Cells(i, 1)
If Columns("E").Find(Cells(j, 1), LookIn:=xlValues) Is Nothing Then Cells(Rows.Count, "E").End(xlUp).Offset(1, 0) = Cells(j, 1)
test = False
End If
Next j
Next i
If test Then
MsgBox "Aucune valeur ne correspondant au critère n'a été trouvé"
Else
MsgBox "Des valeurs ont bien été trouvée" 'facultatif celui là
End If
End Sub |
Partager