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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

write formula to excel

Status
Not open for further replies.

matrixknow

IS-IT--Management
May 3, 2007
78
My code has a sql statement and it writes data to excel.

the first field writes nothing to excel. He should do this because my recordset loops through every field of the query, somethimss he has to write data, somethimes not.
My Excel is a template and in the field where he write the texte1 he overwrite the existing formula in my excel template.

Code:
 texte1 : Null

for this I try to include the formula in my query or sql but the syntax refuse this.

Code:
texte1 : VLOOKUP(.....)

How do I need to write this ?
 
I would guess you would have to write formulas as text or to put quotes around it...


Code:
texte1 : "VLOOKUP(.....)"


That said I don't think it would work. You may have to programatically enter formulas if you want them to come from Access. Also I think you may need to put an equal sign in front of the formula for it to evaluate.

Depending on what you are trying to accomplish, this idea may or not be useful: A better mehod may be to build a workbook that references the data in another sheet or even file. Then you could import the data to Excel to the referenced sheet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top