同时按Alt和F11进入宏界面,点菜单的插入,模块,粘贴如下代码:
Sub test()
Dim i As Integer
For i = 1 To Sheets.Count
Sheets(i).Copy
ActiveWorkbook.SaveAs "F:\temp\" & ActiveSheet.Name & ".xlsx"
ThisWorkbook.Activate
Next i
End Sub
注意SaveAs后面是文件拆分后的文件路径
同时按Alt和F11进入宏界面,点菜单的插入,模块,粘贴如下代码:
Sub test()
Dim i As Integer
For i = 1 To Sheets.Count
Sheets(i).Copy
ActiveWorkbook.SaveAs "F:\temp\" & ActiveSheet.Name & ".xlsx"
ThisWorkbook.Activate
Next i
End Sub
注意SaveAs后面是文件拆分后的文件路径