Sub movefile()
Dim fso As Object
Dim Mfile As File
Dim Sfldr As Folder
Dim Dfldr As Folder
MsgBox "Select Source folder", vbInformation
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
Path = .SelectedItems(1) & "\"
End With
MsgBox "Select Destination folder", vbInformation
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
dpath = .SelectedItems(1) & "\"
End With
Set fso = New FileSystemObject
Set Sfldr = fso.GetFolder(Path)
For Each Mfile In Sfldr.Files
Mfile.Move dpath & Mfile.Name
Next
End Sub
regards,
Vikas Verma
No comments:
Post a Comment