Hello to everyone
Please help me.
I use this vba code to move files(*jpg files) from folder A1 to folder A2.
I want to know which is vba code to copy files from folder A1?
<<Sub MoveFiles()
Dim OldPath As String
Dim NewPath As String
Dim LoopFile As String
Dim FileExt() As String
OldPath = "C:\Test\A1"
NewPath = "C:\Test\A2"
LoopFile = Dir(OldPath & "*.*")
Do While LoopFile <> ""
FileExt = Split(LoopFile, ".")
Select Case FileExt(UBound(FileExt))
Case "jpg"
Name OldPath & LoopFile As NewPath & LoopFile
End Select
LoopFile = Dir
Loop
End Sub>>
Please help me.
I use this vba code to move files(*jpg files) from folder A1 to folder A2.
I want to know which is vba code to copy files from folder A1?
<<Sub MoveFiles()
Dim OldPath As String
Dim NewPath As String
Dim LoopFile As String
Dim FileExt() As String
OldPath = "C:\Test\A1"
NewPath = "C:\Test\A2"
LoopFile = Dir(OldPath & "*.*")
Do While LoopFile <> ""
FileExt = Split(LoopFile, ".")
Select Case FileExt(UBound(FileExt))
Case "jpg"
Name OldPath & LoopFile As NewPath & LoopFile
End Select
LoopFile = Dir
Loop
End Sub>>