Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

paste worksheet into existing wirkbook 1

Status
Not open for further replies.

funkmonsteruk

IS-IT--Management
Feb 8, 2002
210
GB
I'm running some reports which create a new workbook each day, the workbook contains a single worksheet.

I'm trying to run some code when the new workbook is produced which will insert it into an existing workbook which contains reports from previous days.

Any suggestions?
 
Try the DoCmd.TransferSpreadsheet [Transfer type],[Fullpathincluding filename] Be sure to rename the file before exporting. Look in the VBA Editor and search for the object library for syntax.

Thanks,

Jim
 
Assuming the new workbook has just one sheet, and you don't want to keep it after it's added to the summary workbook, use:

LastSheet=workbooks("summary").sheets.count
Sheets(1).Move After:=Workbooks("summary").Sheets(lastsheet)

This moves the sheet to the end of the summary workbook, and automatically activates the summary workbook. If you do want to keep the single-sheet workbook use "copy" instead of "move".
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top