MissaLissa
New Member
- Joined
- Jul 2, 2013
- Messages
- 26
Excel Guru's ray:
I have approx 30 excel files that I need to move to different folders based on the file name. The folders that these files are being moved to already exist. I have some code but it only moves one file, I need help adjusting the code to move all of them to their corresponding folders. Any help would be greatly appreciated.
Move LTCi_Operations.xlsx to folder named LTCi Operations
Move AS_Operations.xlsx to folder named AS Operations
Move Assessment_Services.xlsx to folder named Assessment Services
Etc...
I have approx 30 excel files that I need to move to different folders based on the file name. The folders that these files are being moved to already exist. I have some code but it only moves one file, I need help adjusting the code to move all of them to their corresponding folders. Any help would be greatly appreciated.
Move LTCi_Operations.xlsx to folder named LTCi Operations
Move AS_Operations.xlsx to folder named AS Operations
Move Assessment_Services.xlsx to folder named Assessment Services
Etc...
Code:
Sub Move_Final_Reports()
sSaveFrom = "\\ltcgsrv1\CognosExpress\Final Reports\"
sSaveTo = "\\ltcgsrv1\CognosExpress\Final Reports\LTCi\LTCi Operations\"
sFile = "*LTCi_Operations*.xl*"
Set FSO = CreateObject("scripting.filesystemobject")
FSO.MoveFile Source:=sSaveFrom & sFile, Destination:=sSaveTo
End Sub