how to define a specific sheet in outputto macro

S

stickandrock

I have a macro that I am using the OutputTo function. The output is into an
excel file. It does the function just fine, but I would like to specify the
worksheet name to us. It defaults to the Query name for the excel worksheet
name

query abc

excel file bad.xls
current file and sheet names
Bad.xls worksheet=abc

I want the output from abc
to go into sheet named Data
final file
Bad.xls with a worksheet named Data

I don't want to change the query name though.

thanks,
 
J

John Nurick

Try using TransferSpreadsheet instead of OutputTo, and pass the
worksheet name in the Range argument. You may need to append a ! or $,
e.g.
Data!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top