I have a macro that runs off into a directory structure and copies files (always in the form "v:\A\B\C" where A,B,C vary) to a new directory structure somewhere else that the macro creates based on a list it is supplied. This works fine.
However, I've now discovered that sometimes there are subdirectories in C which need to be copied as well...
How do i adapt (or rewrite if that's easier...) this code to target folders not files (or both at the same time for effeciency i suppose)?
Application.FileSearch.LookIn = "V:\" & A & "\" & B & "\" & C
Application.FileSearch.Filename = "*.*"
If Application.FileSearch.Execute Then
.CopyFile ("V:\" & A & "\" & B & "\" & C & "\" & "*.*") _
, ("V:\" & Name & "\" & Number & "\" & A & "\" & B & "\" & C)
End If
Cheers for any help.
Dave
However, I've now discovered that sometimes there are subdirectories in C which need to be copied as well...
How do i adapt (or rewrite if that's easier...) this code to target folders not files (or both at the same time for effeciency i suppose)?
Application.FileSearch.LookIn = "V:\" & A & "\" & B & "\" & C
Application.FileSearch.Filename = "*.*"
If Application.FileSearch.Execute Then
.CopyFile ("V:\" & A & "\" & B & "\" & C & "\" & "*.*") _
, ("V:\" & Name & "\" & Number & "\" & A & "\" & B & "\" & C)
End If
Cheers for any help.
Dave