Hi Ken
Sorry to bother again but I am trying to give the user two options. One where all the files appear in one folder and one where all the files appear in individual folders.
I have amended the code below to do this for individual folders and it's working fine but the files appear outside the folders instead of inside each individual folder. Could you tell me where I am going wrong?
For i = 1 To rng2.Rows.count
wsM.[F1] = rng2(i).Offset(, -1) 'Reference number for candidate
rn = Trim(wsM.[F1])
count = 1
'Iterate each file item and copy files and make pdf for candidate.
For Each c1 In rng1
If c1.Offset(, 3) <= 0.5 Andcount <= 5 And _
Not .FileExists(p2 & rn &"." & .GetFileName(c1)) Then
If .FileExists(c1) Then
.CopyFile c1, p2 & "\" & rn & "." & .GetFileName(c1)
count =count + 1
End If
End If
Next c1