Sub CopySheetToNewBook()
Sheets("Sheet8").Copy
ActiveWorkbook.SaveAs "C:MrExcelNewBook-Oct06" & ".xls"
ActiveWorkbook.Close
End Sub
On 2002-10-07 00:25, Yogi Anand wrote:
Hi Aries:
Try ...
Code:Sub CopySheetToNewBook() Sheets("Sheet8").Copy ActiveWorkbook.SaveAs "C:MrExcelNewBook-Oct06" & ".xls" ActiveWorkbook.Close End Sub
I have copied sheet8 and saved the file as NewBook-Oct06.xls in MrExcel folder of C: drive -- please adjust the file path as you want.
Regards!
Yogi
This message was edited by Yogi Anand on 2002-10-07 00:27
Sub CopySheetToNewBook()
Worksheets("Sheet1").Copy
End Sub
On 2002-10-07 16:41, Yogi Anand wrote:
Hi Aries:
Your code should work -- are you sure that sheet1 does exist in your workbook from where you are executing the procedure.
for me the following code does work ...
Code:Sub CopySheetToNewBook() Worksheets("Sheet1").Copy End Sub
Execution of the code created a new workbook for me with only sheet1 as the only worksheet.
You may want to check your actual code as written in the module for any errors that may not be obvious.
Regards!
Yogi