1.原文件
2.拆分后
3.具体操作:打开需要拆分的excel,在任意工作表右击,点击“查看代码”
输入代码
Private Sub 分拆工作表()
Dim sht As Worksheet
Dim MyBook As Workbook
Set MyBook = ActiveWorkbook
For Each sht In MyBook.Sheets
sht.Copy
ActiveWorkbook.SaveAs Filename:=MyBook.Path & "\" & sht.Name, FileFormat:=xlOpenXMLWorkbook '将工作簿另存为xlsx格式
ActiveWorkbook.Close
Next
MsgBox "文件已经被分拆完毕!"
End Sub
4.执行
5.遇到的问题
点击是继续即可