The macro below will move ALL files from a specified path (with multiple subfolders) to another folder. However, how do you change this code so that it will move ONLY txt files?
Code:
Sub MoveFiles()
Dim fso, fldr, subFldr, oFiles, oFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.GetFolder("E:\DILPA\Compile\Compiled\")
For Each subFldr In fldr.SubFolders
Set oFiles = subFldr.Files
For Each oFile In oFiles
oFile.Move "I:\4xmit\4xmit 2moro\"
Next
Next
Set oFiles = Nothing
Set subFldr = Nothing
Set fldr = Nothing
Set fso = Nothing
End Sub