everyone, I need to split a excel file which contains multiple worksheets into individual excel files based on the different worksheet names. I found a VBA code which works very well.
However, now I need to create a batch file to run the VBA code automatically, how to reach this functionality? Since I do not have strong code experience,
hope some one would tell me or give a hint. Here is the code:
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