export query with formulas to excel

M

mark

Is there a way to export my Access query to Excel 2003 while keeping the
formulas in Excel. For example, in my Access query I have a field called
"Other" which is defined as the following:

Other: [DiffTotal]-[BudTo]

[DiffTotal] and [BudTo] are "real" fields in the query and become columns in
Excel. Instead of having the value of "Other" appear in Excel, I'd like the
"Other" column to have the formula where, for example in row 1, it could look
like "=A3-A2."

Thanks,

~Mark
 
J

Jeff Boyce

When Access exports to Excel, it exports the data, not the formula.

If you are willing to undertake the work of automating Excel, you can use
Access to "push" a formula into Excel.

If you want [DiffTotal] and [BudTo] amounts to go to Excel, send them, then
in Excel, create your formula.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
N

NG

Hi Mark,

It is possible, but the only thing I can come up with is to export the data
without the calculated field to Excel, and then using the excel application
object in Access VBA to open the created workbook, add a column and fill it
with the formula.
 

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