I am trying to move 3000 plus files from various subfolders into a common root folder. I found this code but it does not do exactly what I need.
How do I modify this to take all the files in the sub folders of folder "main" and move them all into folder "Main". Another way to look at this is I want to eliminate the subfolders but keepp the files they contain.
Code:
Sub movefiles()
Dim fto As String
Dim ffrom As String
'folder from
ffrom = "\\original server folder"
'folder to
fto = "\\Destination server folder\"
'looks for any file in the folder from directory
MyFile = Dir(ffrom & "\*", vbNormal)
'moves every file until its empty.
Do While MyFile <> ""
Name ffrom & "\" & MyFile As fto & MyFile
MyFile = Dir
Loop
End Sub
How do I modify this to take all the files in the sub folders of folder "main" and move them all into folder "Main". Another way to look at this is I want to eliminate the subfolders but keepp the files they contain.