将Excel按照sheet分拆成文件,可以通过如下代码:
Private Sub 分拆工作表()
Dim ws As Worksheet
Dim bybook As Workbook
Set bybook = ActiveWorkbook
For Each ws In bybook .Sheets
ws.Copy
ActiveWorkbook.SaveAs Filename:=bybook .Path & "\" & ws.Name, FileFormat:=xlNormal
ActiveWorkbook.Close
Next
MsgBox "分拆完成!"
End Sub