How many files are there in the Z drive folder that don't need copying? If it's not too many, and all of the files start with the 4 digit ID I would approach this by first copying the whole folder from Z to C and then searching for all files in the folder on C drive. Sort by name and you should get all the files with numbers at the top.
It's probably easier to copy the files across and delete the ones you don't want with VBA for what it's worth, then you don't need to deal with creating the subfolder structure and can just cycle through all the files/folders and look at each filename.
It would help if you could provide a bigger list of example filenames, especially if they are incorrectly named/filed to work out what the condition needs to be to filter out the files.
If it's any help, I made this macro to copy my outlook folder structure and files to a network drive, which isn't too disimilar to what you are looking to do:
Sub Mail_Backup()
Dim namespc, Archive_In, Archive_Out, Backup_Folder, fs, f
Set namespc = Application.GetNamespace("MAPI")
Set Archive_In = namespc.Folders("Archive (In)")
Set Archive_Out = namespc.Folders("Archive (Out)")
Set fs = CreateObject("scripting.filesystemobject")
Set Backup_Folder = fs.createfolder("R:\Acoustics\J. Hill\Mail Backup " & Strings.Left(Now, 2) & " " & Strings.Mid(Now, 4, 2) & " " & Strings.Mid(Now, 9, 2) & " " & Strings.Mid(Now, 12, 2) & " " & Strings.Mid(Now, 15, 2) & " " & Strings.Mid(Now, 18, 2))
fs.createfolder (Backup_Folder & "\" & "Archive In")
fs.createfolder (Backup_Folder & "\" & "Archive Out")
Call Create_Backup(Backup_Folder & "\" & "Archive In", Archive_In, fs)
Call Create_Backup(Backup_Folder & "\" & "Archive Out", Archive_Out, fs)
End Sub
Sub Create_Backup(Backup_Folder As Variant, Archive_In As Variant, fs As Variant)
Dim i, f
Dim a As Integer
For Each i In Archive_In.Items
i.SaveAs (Backup_Folder & "\" & a & ".msg")
a = a + 1
Next
For Each f In Archive_In.Folders
fs.createfolder (Backup_Folder & "\" & f)
Call Create_Backup(Backup_Folder & "\" & f, f, fs)
Next
End Sub
Bookmarks