Sub kk()
pa = "C:\Users\kk\Desktop\结果文件"
If pa = "" Then MsgBox "Path is empty": End
If Dir(pa, vbDirectory + vbHidden) = "" Then MsgBox "Path does not exist": End
File = Dir(pa & "\*.xls*")
Do Until LenB(File) = 0
If File <> ThisWorkbook.Name Then
Workbooks.Open Filename:=pa & "\" & File
Workbooks(Workbooks.Count).Save
Workbooks(Workbooks.Count).Close
End If
File = Dir
Loop
MsgBox "OK"
End Sub
社区管理员
KVP函数专家、创作者俱乐部成员
KVP函数专家、创作者俱乐部成员
KVP函数专家、创作者俱乐部成员
创作者俱乐部成员
@金山办公
创作者俱乐部成员