如何将一个Excel中的多个sheet生成多个新的Excel文件。比如将一个Excel中有3个sheet生成3个新的Excel文件
3个回答
展开全部
End SubSub 按工作表拆分()
Dim Sh As Worksheet, N As Long
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each Sh In Worksheets
N = N + 1
Sh.Copy
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & Sh.Name, xlWorkbookNormal
ActiveWorkbook.Close True
Next
Application.ScreenUpdating = True
Application.DisplayAlerts = True
MsgBox "共拆分出 " & N & "个表格为单独工作簿" & vbCrLf & "文件保存于:" & ThisWorkbook.Path & "\"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |