Sub æå¼1()
Dim myPath$, AK As Workbook, OAK As Workbook, strName As String
Set FSO = CreateObject("Scripting.FileSystemObject")
Set OAK = ActiveWorkbook
myPath = "C:\Users\Administrator\Desktop\æ°å»ºæ件夹" âä¿®æ¹ä¸ºæ件路å¾
Application.ScreenUpdating = False
Set FD = FSO.GetFolder(myPath)
I = 1
For Each f In FD.Files
strName = f
strName = VBA.Right(strName, 3)
If strName = "xls" Or strName = "lsx" Then
Set AK = Workbooks.Open(f.Path, , fasle)
AK.Sheets("Sheet1").Select
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
AK.Save
AK.Close False
I = I + 1
Else
End If
Next
Application.ScreenUpdating = True
End Subæ¥èªï¼æ±å©å¾å°çåç
温馨提示:答案为网友推荐,仅供参考