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:
"#VALUE!"
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?

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] & "'"?

tgifgemini

Don't use the & immedietly after the = . (I suspect that's just a typo). Otherwise yes

I already tried that but it didn't work.
tgifgemini

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.