Work Books Sheets copy to Multiple WorkBooks and Rename and Save
I have workbook and there many sheets i want to copy one by one sheets to new work book and rename workbook and save except first sheet
I tried many times, but it saved in one workbook instead of separate workbooks
Code:
Sub CreateWorkBooks()
Dim ws AsObject
Dim i AsLong
Dim ws_num AsInteger
Application.ScreenUpdating =False
Set ws = Worksheets
ws_num = ThisWorkbook.Worksheets.Count
For i =2To ws_num
'Copy one worksheet as a new workbook
'The new workbook becomes the ActiveWorkbook
ws.Copy
'Replace all formulas with values (optional)
ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value
'May want (not required) to add a file name extension (.xls or .xlsx) to the file name
ActiveWorkbook.SaveAs ThisWorkbook.Path &"\"& _
"AR Balance- "& ActiveSheet.Name &" "& Worksheets("DATA Sheet").Range("m2")&".xlsx"
ActiveWorkbook.Close SaveChanges:=False
Next
Application.ScreenUpdating =True
EndSub