![]() |
Help exporting worksheets/data to a workbook.
I am trying to determine the most effective way to accomplish this
goal... I have a workbook with 5 worksheets each of which pulls data from various locations and some manipulations made. I am trying to export 2 sheets that are generated as a workbook with a time-date stamp as the file name. I am trying to figure out if it is best to create the workbook from code and copy the sheets or open an existing workbook, write the data and "save as." Any help, insight, and code snippets would be greatly appreciated. Additionally, I am looking for a good resource for excel object definitions (with proper use of properties and methods) TIA!!! |
Help exporting worksheets/data to a workbook.
Worksheets(Array("Sheet3","Sheet5")).Copy
creates a new workbook containing a copy of Sheet3 and Sheet5. -- Regards, Tom Ogilvy <Tbird wrote in message ... I am trying to determine the most effective way to accomplish this goal... I have a workbook with 5 worksheets each of which pulls data from various locations and some manipulations made. I am trying to export 2 sheets that are generated as a workbook with a time-date stamp as the file name. I am trying to figure out if it is best to create the workbook from code and copy the sheets or open an existing workbook, write the data and "save as." Any help, insight, and code snippets would be greatly appreciated. Additionally, I am looking for a good resource for excel object definitions (with proper use of properties and methods) TIA!!! |
Help exporting worksheets/data to a workbook.
Here's one way. Select the worksheets to copy.
Sub NewWB() ActiveWorkbook.Windows(1).SelectedSheets.Copy ActiveWorkbook.SaveAs FileName:=Format(Now, _ "mmddyyyy hhmmss") End Sub HTH Paul -------------------------------------------------------------------------------------------------------------- Be advised to back up your WorkBook before attempting to make changes. -------------------------------------------------------------------------------------------------------------- I am trying to determine the most effective way to accomplish this goal... I have a workbook with 5 worksheets each of which pulls data from various locations and some manipulations made. I am trying to export 2 sheets that are generated as a workbook with a time-date stamp as the file name. I am trying to figure out if it is best to create the workbook from code and copy the sheets or open an existing workbook, write the data and "save as." Any help, insight, and code snippets would be greatly appreciated. Additionally, I am looking for a good resource for excel object definitions (with proper use of properties and methods) TIA!!! |
All times are GMT +1. The time now is 07:45 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com