Split Excel workbook into multiple file VBA Code:
Sub splitbook()
'updateby educational revolution
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
Comments
Post a Comment