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!

Outputting Querys to Excel 1

Status
Not open for further replies.

MikeC14081972

Programmer
May 31, 2006
137
GB
I know this has been done before nut I can not find the original thread.

Using DoCmd.TransferSpreadsheet you can output the results of a query to an Excel Spreadsheet.

However, is there a way to output the results of 2 querys to different worksheets in the same workbook?

Thanks Mike
 
Have a look at this description of the TransferSpreadSheet function.

Note particularly the "File Name" and "Range" parameters that tell you how to specify a Worksheet name for the export.

 
Dooh. Hit head against wall

I use that all the time for importing didn't think about exporting.

Thanks
 
link_above said:
Note When you export to a spreadsheet, you must leave this argument blank. If you enter a range, the export will fail
 
have tested this and it didn't fail as long as you remove the ! from the range and use a name other than a sheet already in the workbook then the command will create the worksheet with the output of the query,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top