生成代碼如下:生成VBA代碼,Excel檔內的每個工作表,各自生成一個新的Excel檔,存在原來的路徑下
代碼: 選擇全部
Sub SplitWorksheetsIntoWorkbooks()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Copy
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\" & ws.Name & ".xlsx"
ActiveWorkbook.Close False
Next ws
End Sub
1.打開 區域業務績業.xlsx
2.按ALT+F11