Hello All,
I am trying to take a few sheets from a workbook and create a new workbook with them. I have been using the following code listed below and It works. The problem is that it is somewhat slow. I have this in a loop and need to run it a few hundred times which is time consuming.
Is there a way to create a new workbook with these sheets without having to open it and close it again? Or any other way that might be faster?
Sheets(Array("Sheet1", "Sheet2", "Sheet4", "Sheet5")).Copy
ActiveWorkbook.SaveAs Filename:=xlsPath + "\ASSET ID " & asset & " " & recdate & " " & ".xls", CreateBackup:=False
ActiveWorkbook.Close
Thank You,
Sisb
I am trying to take a few sheets from a workbook and create a new workbook with them. I have been using the following code listed below and It works. The problem is that it is somewhat slow. I have this in a loop and need to run it a few hundred times which is time consuming.
Is there a way to create a new workbook with these sheets without having to open it and close it again? Or any other way that might be faster?
Sheets(Array("Sheet1", "Sheet2", "Sheet4", "Sheet5")).Copy
ActiveWorkbook.SaveAs Filename:=xlsPath + "\ASSET ID " & asset & " " & recdate & " " & ".xls", CreateBackup:=False
ActiveWorkbook.Close
Thank You,
Sisb