大概是这样吧
Option Explicit
Sub test()
Dim OldFolderPath As String, NewFolderPath As Strin
Dim MyFSO As Object
Dim MyFile As Strin
OldFolderPath = "C:\123\"
NewFolderPath = "C:\QQ\"
Set MyFSO = CreateObject("Scripting.FileSystemObject")
MyFile = Dir(OldFolderPath & "*.xls"
Do
If MyFSO.FileExists(NewFolderPath & MyFile) Then
MyFSO.DeleteFile NewFolderPath & MyFile, True
MyFSO.MoveFile OldFolderPath & MyFile, NewFolderPath
Else
MyFSO.MoveFile OldFolderPath & MyFile, NewFolderPath
End If
MyFile = Dir
Loop While MyFile <> ""
End Sub