Access Memo field to Excel with Line Feeds

ejstefl

New Member
Joined
Jul 13, 2005
Messages
3
All,

I am using Access to automate Excel. I have a memo field in Access that contains Line Feeds (Ascii character 10). I am using the following command to enter the text into the cell:

wks.cells(iRow, iCol) = strData

However, I get an error when I do this. I believe this is because I have Line Feeds in the strData variable. When I replace them with Carriage Returns, the code works, but the text in Excel has boxes. I would like to retain the line feeds in Excel, similar to what would happen if I copy the text, go into Excel, hit F2, and Paste.

Can anyone help?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi ejstefl

but the text in Excel has boxes

Please check the format in that cell where you see the "boxes". It should have in the Alignment the Wrap Text option checked.

Hope this helps
PGC
 
Upvote 0
Hi ejstefl

but the text in Excel has boxes

Please check the format in that cell where you see the "boxes". It should have in the Alignment the Wrap Text option checked.

Hope this helps
PGC

Hello,

When I select wrap text, I still see the boxes.

What I'd ideally like is to maintain the LF characters instead of switching them to CR. Any other ideas?
 
Upvote 0

Forum statistics

Threads
1,217,756
Messages
6,138,428
Members
450,136
Latest member
Tabako1960

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top