Sub Test()
Dim Classeur1 As Workbook
Dim Classeur2 As Workbook
Dim Plage1 As Range
Dim Plage2 As Range
Dim Cel1 As Range
Dim Cel2 As Range
Dim Tbl() As String
Dim I As Long
Dim Adr As String
Set Classeur1 = Workbooks("Fichier 1.xlsx")
Set Classeur2 = Workbooks("Fichier 2.xlsx")
With Classeur1.Worksheets("Feuil1"): Set Plage1 = .Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)): End With
With Classeur2.Worksheets("Feuil1"): Set Plage2 = .Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)): End With
For Each Cel2 In Plage2
Set Cel1 = Plage1.Find(Cel2, , xlValues, xlWhole)
If Not Cel1 Is Nothing Then
Adr = Cel1.Address
Do
I = I + 1
ReDim Preserve Tbl(1 To 2, 1 To I)
Tbl(1, I) = Cel1.Value
Tbl(2, I) = Cel1.Address(0, 0)
Set Cel1 = Plage1.FindNext(Cel1)
Loop While Cel1.Address <> Adr
End If
Next Cel2
For I = 1 To UBound(Tbl, 2)
Debug.Print "La valeur '" & Tbl(1, I) & "' a été trouvée dans la cellule >" & Tbl(2, I) & "< de la feuille ""Feuil1"" du classeur 1"
Next I
End Sub