Help exporting worksheets/data to a workbook.

  • Thread starter Thread starter Tbird
  • Start date Start date
T

Tbird

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!!!
 
Worksheets(Array("Sheet3","Sheet5")).Copy

creates a new workbook containing a copy of Sheet3 and Sheet5.
 
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
 
Back
Top