顯示excel開發(fā)工具
選項->自定義功能區(qū)->開發(fā)工具打勾
Visual Basic
點擊 Visual Basic曙蒸,雙擊This workbook凉敲,輸入代碼
Sub 拆分()
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
點擊中間考下的綠色三角符號库物,“運行”。提示完成丈莺,即完成