I have an excel file which contain over 20 worksheets and I understand how to split them into individual files and put their worksheet name as the new workbook name (.xlsx). Below is my vba code.
Sub Splitbook()
MyPath = ThisWorkbook.Path
For Each sht In ThisWorkbook.Sheets
sht.Copy
ActiveSheet.Cells.Copy
ActiveSheet.Cells.PasteSpecialPaste:=xlPasteValues
ActiveSheet.Cells.PasteSpecialPaste:=xlPasteFormats
ActiveSheet.Cells.Hyperlinks.Delete
ActiveWorkbook.SaveAs Filename:=MyPath & "\" & sht.Name & ".xlsx"
ActiveWorkbook.Closesavechanges:=False
Next sht
End Sub
But now, I would like to make some changes.
More detail, My worksheet name as "NOTE", "JAN 16", "FEB 16"....etc
And I would split them as individual file but include the worksheet "NOTE".
which means worksheet "NOTE" + worksheet "JAN 16" --> new workbook name as "JAN 16" ; worksheet "NOTE" + worksheet "FEB 16" --> new workbook name as "FEB 16" ...etc
I have tried many times but have not been successful.
Please help... Thanks in advance.