hi everyone,
i have this macro copied from the internet. i would copy and paste this in the VBe to split the sheets in the same workbook.
can this macro be saved in a template, so I can open simultaneously this template and the the workbook which i need to split the sheets?
my other macros are working while using the shortcuts. thanks.
VBA: Split a workbook into multiple workbooks and save in the same folder.
Sub Splitbook()
Dim xPath As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
xWs.Copy
Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Bookmarks