memo field written to excel

G

Guest

When i write the contents of a memo field to an Excel cell i get squares at
the end of each line, presumably from the enter button. I have tried putting
in a line

invAdd = Replace([invAdd], Chr(13) & Chr(10), "")
xlApp.ActiveSheet.Range("G3") = invAdd

but is still get squares. Any suggestions please
 
J

John Nurick

HI Judith,

Replacing Chr(13) & Chr(10) with nothing, a space or Chr(10) work for
me. Chr(10) gives you a line break in an Excel cell.

Try something like this (assuming you're in a form):

xlApp.ActiveSheet.Range("G3").Formula = _
Replace(Me.invAdd.Value, vbCrLf, vbLf)



When i write the contents of a memo field to an Excel cell i get squares at
the end of each line, presumably from the enter button. I have tried putting
in a line

invAdd = Replace([invAdd], Chr(13) & Chr(10), "")
xlApp.ActiveSheet.Range("G3") = invAdd

but is still get squares. Any suggestions please
 
G

Guest

Perfect, thanks

John Nurick said:
HI Judith,

Replacing Chr(13) & Chr(10) with nothing, a space or Chr(10) work for
me. Chr(10) gives you a line break in an Excel cell.

Try something like this (assuming you're in a form):

xlApp.ActiveSheet.Range("G3").Formula = _
Replace(Me.invAdd.Value, vbCrLf, vbLf)



When i write the contents of a memo field to an Excel cell i get squares at
the end of each line, presumably from the enter button. I have tried putting
in a line

invAdd = Replace([invAdd], Chr(13) & Chr(10), "")
xlApp.ActiveSheet.Range("G3") = invAdd

but is still get squares. Any suggestions please
 

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