Sub Comparer()
Dim F1 As Worksheet, F2 As Worksheet, tablo1, tablo2, ub&, i&, t$, j&, tablo3(), n&
On Error Resume Next
Set F1 = Workbooks("Classeur1.xls").Sheets("Feuil1") 'fichier et feuille à adapter
Set F2 = Workbooks("Classeur2.xls").Sheets("Feuil1") 'fichier et feuille à adapter
If Err Then MsgBox "Vérifier les noms des fichiers et des feuilles." & Chr(10) & _
"Les 2 fichiers doivent être ouverts...": Exit Sub
On Error GoTo 0
tablo1 = F1.Range("A1:C" & F1.[A65536].End(xlUp).Row)
tablo2 = F2.Range("A1:C" & F2.[A65536].End(xlUp).Row)
ub = UBound(tablo2)
For i = 1 To UBound(tablo1)
t = tablo1(i, 1) & tablo1(i, 2)
For j = 1 To ub
If tablo2(j, 1) & tablo2(j, 2) = t Then
ReDim Preserve tablo3(3, n)
tablo3(0, n) = tablo1(i, 1)
tablo3(1, n) = tablo1(i, 2)
tablo3(2, n) = tablo1(i, 3)
tablo3(3, n) = tablo2(j, 3)
n = n + 1
Exit For
End If
Next
Next
If n = 0 Then MsgBox "Aucune ligne commune trouvée...": Exit Sub
Workbooks.Add 'nouveau document
ActiveSheet.[A1].Resize(n, 4) = Application.Transpose(tablo3)
'ensuite, si l'on veut, mise en forme et enregistrement
End Sub