1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Option Explicit
Sub chercherValeur()
Application.ScreenUpdating = False
Dim Trouve As Range, Plage As Range
Dim Valeur_Cherchee As String, cel As Range
Set Plage = Sheets("F01").Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
For Each cel In Sheets("F03").Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
Valeur_Cherchee = cel.Value
Set Trouve = Plage.Cells.Find(what:=Valeur_Cherchee, LookAt:=xlWhole)
If Trouve Is Nothing Then
Cells(cel.Row, 2) = Valeur_Cherchee & " n'est pas présent dans F1 " & Plage.Address
Else
Cells(cel.Row, 2) = "valeur Existe en " & Trouve.Address
End If
Next cel
Set Plage = Nothing
Set Trouve = Nothing
Application.ScreenUpdating = True
End Sub |
Partager