Bonjour tout le monde, essaye ceci :
Dim i As Long, sh As Worksheet, Fs As Object
Dim nL As Long
Set sh = Sheets("test")
Set Fs = CreateObject("Scripting.FileSystemObject")
nL = sh.Range("B" & Rows.Count).End(xlUp).Row
For i = 2 To nL
If UCase(sh.Range("D" & i).Value) = "OUI" Then
If Fs.FileExists(sh.Range("E" & i)) Then Fs.MoveFile sh.Range("E" & i), sh.Range("F" & i) & "\" & Fs.GetFileName(sh.Range("E" & i))
End If
Next i
Je pense que ce truc n'est pas très orthodoxe, mieux vaut prendre une variable intermédiaire.
For i = 2 To sh.Range("B" & Rows.Count).End(xlUp).Row