Sub test()
Dim MonTab1 As Variant, Compt11 As Long, Plg1 As Range
With Feuil1 'Déclaration implicite de l'objet feuil1
lig = 2
With Feuil4
.Cells(1, 1) = "Intervention": .Cells(1, 2) = "Conclusion": .Cells(1, 3) = "Code": .Cells(1, 4) = "Genre_Intervention": .Cells(1, 5) = "Statut": .Cells(1, 6) = "Date_début": .Cells(1, 7) = "Date_fin": .Cells(1, 8) = "Code_Inspecteur": .Cells(1, 9) = "Anomalie": .Cells(1, 10) = "Numero_demande": .Cells(1, 11) = "Date_Creation_Demande": .Cells(1, 12) = "Nom_Inspecteur": .Cells(1, 13) = "Prenom_Inspecteur": .Cells(1, 14) = "Domaine_Intervention"
.Rows(1).Font.Bold = True
End With
For i = 2 To .UsedRange.Rows.Count 'traitement de la ligne 2 à la dernière ligne non vide
Z = .Cells(i, 13) & Chr(32) & .Cells(i, 12) 'dans la variable z j'écris le nom et prénom séparé par un espace
Set trouve = Feuil2.Columns(3).Find(Z, lookat:=xlWhole) 'j'indique de rechercher la valeur de z dans la colonne 2
If Not trouve Is Nothing Then 'si un résultat est trouvé
For Compt11 = LBound(MonTab1, 1) To UBound(MonTab1, 1)
MonTab1(Compt11, 4) = MonTab1(Compt11, 4) ' colonne 4
MonTab1(Compt11, 5) = MonTab1(Compt11, 5) 'colonne 5
MonTab1(Compt11, 14) = MonTab1(Compt11, 14) ' colonne 14
Next Compt11
End If
Next i
Plg1.Value = MonTab1
End With
End Sub