|
Sub 批量转换格式()
Application.ScreenUpdating = False
Dim FilePath, MyFile, iPath As String
iPath = ThisWorkbook.Path
MyFile = Dir(iPath & "\*.CSV")
On Error Resume Next
Do While MyFile <> ""
Workbooks.Open (iPath & "\" & MyFile)
MyFile = ActiveWorkbook.Name
MyFile = Replace(MyFile, ".csv", ".xlsx", 1, -1, 1)
FilePath = iPath & "\" & MyFile
ActiveWorkbook.SaveAs Filename:=FilePath, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
Workbooks(MyFile).Close True
MyFile = Dir
Loop
Application.ScreenUpdating = True
ThisWorkbook.Close False
End Sub
以上代码,可用(已测) |
评分
-
1
查看全部评分
-
|