Option Explicit
Sub Extraire()
Application.ScreenUpdating = False
Dim t, t1, t2, i As Integer, j As Integer, k As Integer, m As Integer
Workbooks("classeur2 Ivan.xlsx").Activate
t = ActiveWorkbook.Sheets("extraction").Range("A2:C383")
ReDim t1(1 To UBound(t), 1 To UBound(t))
Workbooks("classeur1 Ivan.xlsm").Activate
[AO2].Resize(UBound(t, 1), 3) = t
j = 1
m = 1
For i = 1 To UBound(t)
If Cells(i + 1, 42) = "EMLCFM" Then
For k = 1 To UBound(t)
If Cells(k + 1, 41) = Cells(m + 1, 14) Then
t1(j, 1) = Cells(k + 1, 43)
j = j + 1
m = m + 1
End If
Next k
End If
Next i
[AD2].Resize(UBound(t1, 1), 1) = t1
For i = 1 To UBound(t)
If Cells(i + 1, 42) = "LIVCFM" Then
If Application.CountIf(Range("n2:n23"), Cells(i + 1, 41)) Then
Application.Index(Range("n2:n23"), Application.Match(Cells(i + 1, 41), Range("n2:n23"), 0), 1).Offset(, 17) = Cells(i + 1, 43)
End If
End If
Next i
[AO2].CurrentRegion.Delete
Application.ScreenUpdating = True
End Sub