Exporting to multiple sheets in Excel from Access

D

David

Is there a way to export an Access table such that the
value in a selected column can be used to identify
specific sheets in a workbook for the data? For example,
if the first field contains the values A, B and C. Is
there a way I can set up the export so all the A records
are exported to sheet A, the B records to sheet B and the
C records to sheet C in a workbook?
 
J

John Nurick

Hi David,

Set up three queries - let's call them qryA, qryB, qryC, one returning
each set of records. Then either:

-create a macro that calls the TransferSpreadsheet action three times,
once to export qryA to your desired workbook with a Range argument of A,
the second time to export qryB to the same workbook with a Range
argument of B, and so on; or

-use VBA code to call TransferSpreadsheet the three times, passing the
sheet name in the Range argument.
 

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