Good morning everybody.
I need a quick direction here. A column ("Comments") in my spreadsheet that is is supposed to have text values is displaying:
Note: my input data is coming from an access query.
The underlined Below is the data in the "Comments" field in the query (recordset):
"3/21/2005: Compare this new file with the file created in the last pay cycle of 2004",
But when imported to the spreadsheet, it displays "#VALUE!" instead.
What am I doing wrong?


10 Years
Discussion Span
Last Post by tgifgemini

Most probably Excel is trying to compute "3/21/2005" as a number or date. Then it is finding some text and getting messed up. If possible, try putting the 3/21/2005 part within quotes : "'3/21/2005' : Compare ..." etc.


You are correct in your analysis. However, how do I tweak to code to accomplish the objective?

This is the code that is populating that column:

xlWksht.Cells(ii, 9).Value = rsin![Comments]

This is the data from the query(recordset):
"3/21/2005: Compare this new file with the file created in the last pay cycle of 2004"

You mean I should do something like this?:

xlWksht.Cells(ii, 9).Value = & "'" & rsin![Comments] & "'"?


Edited by pyTony: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.