This is why it’s important to save the file in the folder first and then use this code. The above code is written in a way that it picks up the location of the folder using the path of the file (in which the code is run). Once you have this done, then you can put the above VBA code in the file and run the code. Save the main Excel file (which has all the worksheets that you want as separate files) in this folder.Create a folder where you want to get all the resulting files.There are a few things you need to make sure before using the above VBA code: To split these sheets into a separate Excel file, you can use the below VBA code: 'Code Created by Sumit Bansal from Ī Filename:=FPath & '\' & ws.Name & '.xlsx' Suppose you have a workbook as shown below where you have a worksheet for each month. Split Each Worksheet Into a Separate Excel File Split Only those Worksheets that Contain a Word/Phrase into Separate Excel Files.Split Each Worksheet and Save as a Separate PDFs.
Split Each Worksheet Into a Separate Excel File.