EXCEL用VBA代码拆分sheet为新EXCEL文件

新文件用sheet名命名,sheet为当前sheet名

Sub Macro1()
  Dim sht As Worksheet
  Application.ScreenUpdating = False
  Application.DisplayAlerts = False
  For Each sht In Sheets
  sht.Copy
  ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & sht.Name & ".xls"
  ActiveWorkbook.Close
  Next
  Application.DisplayAlerts = True
  Application.ScreenUpdating = True
End Sub


你可能感兴趣的:(EXCEL用VBA代码拆分sheet为新EXCEL文件)