微信号:
当前位置:首页 > 资讯文摘 > 新闻资讯

Excel分拆sheet成文件

2022/12/10 13:22:58
将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
 
相关新闻: