Hello,
I have a number of *.xls files and one Master.xlsm file in C:\Rowfile.
The *.xls files should be moved to C:\Donefiles. The Master.xlsm should stay.
VBA moves all the files despite the fact I set *.xls for files to be moved.
Thank you for any help.
Here is the code:
Sub Move_xlsFiles_to_Done()
Dim FSO As Object
Dim fromDir As String
Dim toDir As String
Dim fExt As String
Dim fNames As String
fromDir = "C:\Rawfiles\"
toDir = "C:\Donefiles\"
fExt = "*.xls"
fNames = Dir(fromDir & fExt)
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.MoveFile Source:=fromDir & fExt, Destination:=toDir
End Sub
I have a number of *.xls files and one Master.xlsm file in C:\Rowfile.
The *.xls files should be moved to C:\Donefiles. The Master.xlsm should stay.
VBA moves all the files despite the fact I set *.xls for files to be moved.
Thank you for any help.
Here is the code:
Sub Move_xlsFiles_to_Done()
Dim FSO As Object
Dim fromDir As String
Dim toDir As String
Dim fExt As String
Dim fNames As String
fromDir = "C:\Rawfiles\"
toDir = "C:\Donefiles\"
fExt = "*.xls"
fNames = Dir(fromDir & fExt)
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.MoveFile Source:=fromDir & fExt, Destination:=toDir
End Sub