Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Pamela Baker   on Mar 02 In MS Office Category.

  
Question Answered By: Hubert Taylor   on Mar 02

Try this

Sub Movefile()
Dim SourceFolder As String, TargetFolder As String
Dim fs, f, f1, fc, sf, tf
SourceFolder = "T:\Accounting\BANKING\Bank of America\Schedule\"
TargetFolder = "T:\Accounting\BANKING\Formatted Data Files\"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(SourceFolder)
Set fc = f.Files
For Each f1 In fc
If Right(f1.Name, 3) = "csv" Then
sf = SourceFolder & f1.Name
tf = TargetFolder & f1.Name
Name sf As tf
End If
Next
MsgBox "Done"
End Sub

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Move & Rename File Or get search suggestion and latest updates.


Tagged: