Sub Ex()
Dim Path As String, A As String, Oldname As String, Newname As String
Path = ThisWorkbook.Path '¸ô®|
A = Dir(Path & "\*.CSV")
Do While A <> ""
Oldname = Path & "\" & A
A = Replace(A, "°ò·Ç¤é¡G", "")
A = "539_" & A '·s¼W»Ý¨D:¦A±NÀɮצWºÙ«e§å§ï¼W¥[ "539_"
A = Replace(A, ".csv", ".xls")
Newname = Path & "\" & A
'Name Oldname As Newname '§ï¦WºÙ
With Workbooks.Open(Oldname)
.SaveAs Filename:=Newname, FileFormat:=xlNormal '§ï°ÆÀɮצW
.Close True
End With
Kill Oldname
A = Dir
Loop
End Sub
Option Explicit
Sub Ex()
Dim oPath As String, A As String, Oldname As String, Newname As String
Application.ScreenUpdating = False
oPath = ThisWorkbook.Path '¸ô®|
A = Dir(oPath & "\*.CSV")
Do While A <> ""
Oldname = oPath & "\" & A
A = Replace(A, "°ò·Ç¤é¡G", "")
A = "539_" & A '·s¼W»Ý¨D:¦A±NÀɮצWºÙ«e§å§ï¼W¥[ "539_"
A = Replace(A, ".csv", ".xls")
Newname = oPath & "\" & A
With Workbooks.Open(Oldname)
.Sheets(1).Name = Replace(A, ".xls", "")
.SaveAs Filename:=Newname, FileFormat:=xlNormal '§ï°ÆÀɮצW
.Close True
End With
Kill Oldname
A = Dir
Loop
End Sub