Bonjour,
ColRef.Row n'existe pas, c'est rng.Row qu'il faut utiliser.
Ceci fonctionne ... il restera à corriger le nom du profil ...
Il y a aussi la recherche sur B en Feuil2.
Sub MatchName()
Dim x As Worksheet, y As Worksheet
Dim rng As Range
Dim iLast As Long
Dim iCounter As Integer
Dim Source, Destination As String
Set x = Worksheets("Sheet1")
Set y = Worksheets("Sheet2")
iLast = x.Range("A" & Application.Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
For iCounter = 2 To iLast
On Error Resume Next
Set rng = y.Range("B:B").Find(x.Range("A" & iCounter).Value)
If Not rng Is Nothing Then
If x.Cells(iCounter, 2).Value = False Then
Source = y.Cells(rng.Row, "C").Value
Destination = "C:\Users\Black_Hole\Desktop\OUTPUT\" & y.Cells(rng.Row, "A").Value
FileCopy Source, Destination
End If
Else
x.Cells(iCounter, 2).Value = "TRUE"
End If
Next iCounter
Application.ScreenUpdating = True
End Sub
ric