EXCEL通过VBSCRIPT将每个sheet分离出N个独立EXCEL文件

首先使用ALT+F11 调用 VBScript

然后 “插入”>"模块"

执行脚本

Sub SheetstoWorkbook()
Dim i
Dim sht As Worksheet
Application.DisplayAlerts = False
For Each sht In Sheets
sht.Copy
i = ThisWorkbook.Path & "\" & sht.Name & ".xlsx"
ActiveWorkbook.SaveAs i
ActiveWorkbook.Close
Next
Application.DisplayAlerts = True
MsgBox "本工作簿内的所有工作表已成功拆分独立工作簿!", vbOKOnly, "无非课堂温馨提示”"
End Sub

 

运行。

posted @ 2024-08-05 08:11  小小的风  阅读(14)  评论(0编辑  收藏  举报