forsing newlines into strings and exporting them to Excel. vbCRLF does not work.

B

Bill Nicholson

If I build a string in a table and then put that string into a query, then
use the query as the recordsource for a report, I can force Carriage
Return/Line Feeds into the report field by putting the VBA constant vbCrLf
between each line of the string/field. However, if I export that report to
Excel, then the vbCrLf becomes two vertical lines between the strings and
they all run together in the worksheet cell.

I looked at the contents of another worksheet cell (not created by
exporting from Access) that appeared to have forced carriage return/line
feeds between the lines and the only character in the cell between the lines
was a single character which was a hex 0A, or a decimal 10. I used that in
my VBA code instead of the vbCrLf and recreated the report and re-exported
it to Excel but it came out with one vertical line character between the
strings and it didn't force them apart onto separate lines.

Any thoughts?

By the way, how do I manually force a carriage return/ line feed between
lines in an excel worksheet cell? I don't even know how to do that.

Thanks!



Bill

Cincinnati, OH USA
 

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