By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

Code to Export Multiple Tables to Excel

P: n/a
Friends,

I need help with some code to export different tables to a single
spreadsheet in Excel.
My excel file is named REPORT and the spreadsheet is named CLIENTS.
I do have the code to export a single table to Excel but have problems
with multimple tables.

Thanks.
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
jp***@tin.it (Paolo) wrote in message news:<9f**************************@posting.google. com>...
Friends,

I need help with some code to export different tables to a single
spreadsheet in Excel.
My excel file is named REPORT and the spreadsheet is named CLIENTS.
I do have the code to export a single table to Excel but have problems
with multimple tables.

Thanks.


Paolo,
use the code at www.mvps.org/access to do this. You could pass the
contents of the table as a recordset to Excel and then put it wherever
you want through automation. You'd just call the code once per table
and tell Excel where to put the data.
Nov 12 '05 #2

P: n/a
Thanks but it seem a bit too complicated for me. You see my big
problem is that my tables display their data in a way while the
spreadsheet will display records in a portrait way. I have tried to
run a crosstab query but it does not return what I want.

Could you just help me with some code example?

Let's say I have two tables: TBL1 and TBL2.

These tables have 4 fields each: DATE, RECEIVED, CLEARED, PENDING.

Data is displayed in the tables as follows:
DATE RECEIVED CLEARED PENDING
01/03 12 23 0
02/03 55 22 4
03/03 45 53 2

My spreadsheet in Excel is named CLIENTS

Data will need to be exported in a pre-formatted spreasheet as
follows:

DATE JAN FEB MARCH
RECEIVED 12 55 45
CLEARED 23 22 0
PENDING 0 4 2
These are the spradsheet cells:

DATE JAN FEB MARCH
RECEIVED B2 C2 D2
CLEARED B3 C3 D4
PENDING B4 C4 D5

I know this seems crazy but I have no choice.

Conclusion: I need some code that reads exports at the same time the
data in the same spreadsheet.

Any further help will be appreciated. Thanks.

pi********@hotmail.com (Pieter Linden) wrote in message news:<bf**************************@posting.google. com>...
jp***@tin.it (Paolo) wrote in message news:<9f**************************@posting.google. com>...
Friends,

I need help with some code to export different tables to a single
spreadsheet in Excel.
My excel file is named REPORT and the spreadsheet is named CLIENTS.
I do have the code to export a single table to Excel but have problems
with multimple tables.

Thanks.


Paolo,
use the code at www.mvps.org/access to do this. You could pass the
contents of the table as a recordset to Excel and then put it wherever
you want through automation. You'd just call the code once per table
and tell Excel where to put the data.

Nov 12 '05 #3

P: n/a
jp***@tin.it (Paolo) wrote in message news:<9f**************************@posting.google. com>...
Thanks but it seem a bit too complicated for me. You see my big
problem is that my tables display their data in a way while the
spreadsheet will display records in a portrait way. I have tried to
run a crosstab query but it does not return what I want.

Could you just help me with some code example?

Let's say I have two tables: TBL1 and TBL2.

These tables have 4 fields each: DATE, RECEIVED, CLEARED, PENDING.

Data is displayed in the tables as follows:
DATE RECEIVED CLEARED PENDING
01/03 12 23 0
02/03 55 22 4
03/03 45 53 2

My spreadsheet in Excel is named CLIENTS

Data will need to be exported in a pre-formatted spreasheet as
follows:

DATE JAN FEB MARCH
RECEIVED 12 55 45
CLEARED 23 22 0
PENDING 0 4 2
These are the spradsheet cells:

DATE JAN FEB MARCH
RECEIVED B2 C2 D2
CLEARED B3 C3 D4
PENDING B4 C4 D5

I know this seems crazy but I have no choice.

Conclusion: I need some code that reads exports at the same time the
data in the same spreadsheet.

Paolo,
so what happens if you create a crosstab query in Access, and then use
the code from mvps.org to open the query recordset and paste the
contents into Excel?
Nov 12 '05 #4

P: n/a
OK. It just does not group the data as I want. Do you have a practice
Example or Can I send you a sample of a table and spreadsheet? Thanks.
pi********@hotmail.com (Pieter Linden) wrote in message news:<bf**************************@posting.google. com>...
jp***@tin.it (Paolo) wrote in message news:<9f**************************@posting.google. com>...
Thanks but it seem a bit too complicated for me. You see my big
problem is that my tables display their data in a way while the
spreadsheet will display records in a portrait way. I have tried to
run a crosstab query but it does not return what I want.

Could you just help me with some code example?

Let's say I have two tables: TBL1 and TBL2.

These tables have 4 fields each: DATE, RECEIVED, CLEARED, PENDING.

Data is displayed in the tables as follows:
DATE RECEIVED CLEARED PENDING
01/03 12 23 0
02/03 55 22 4
03/03 45 53 2

My spreadsheet in Excel is named CLIENTS

Data will need to be exported in a pre-formatted spreasheet as
follows:

DATE JAN FEB MARCH
RECEIVED 12 55 45
CLEARED 23 22 0
PENDING 0 4 2
These are the spradsheet cells:

DATE JAN FEB MARCH
RECEIVED B2 C2 D2
CLEARED B3 C3 D4
PENDING B4 C4 D5

I know this seems crazy but I have no choice.

Conclusion: I need some code that reads exports at the same time the
data in the same spreadsheet.

Paolo,
so what happens if you create a crosstab query in Access, and then use
the code from mvps.org to open the query recordset and paste the
contents into Excel?

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.