View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mark Thorpe Mark Thorpe is offline
external usenet poster
 
Posts: 11
Default Weird problem!

In Access, and most other application, a line feed is actually represented
as two characters: carriage return (code 13) + line feed (code 10). In
Excel, however, a line feed within a cell is represented as only the single
line feed character (code 10). The carriage return shows up as a box or
vertical bar. Looks like the line feed also is not interpreted correctly
when preceded by the carriage return until after you edit the cell.

You could write a macro to simply replace all instances of CR + LF with just
a LF. For example:

text = Cells(row,col).Value
Cells(row, col).Value = Replace(text, Chr(13) + Chr(10), Chr(10))


"Dan" wrote in message
...
Hi!

I have a problem that I hope someone will be able to help me with. I have

an Access table that I exported to Excel. Some of the data has linfeeds in
them, separating small paragraphs. For some reason, it displays these
linefeeds as single heavy vertical bars. I tried it another way and it
displays linefeeds as square boxes. The funny thing is, it displays the
linefeed correctly in the address bar. Then, when I click anywhere in the
address bar of one of those suspect cells and then press enter, it displays
the linefeed correctly in the cell. Any ideas???

Any help would be greatly appreciated.

Thanks a lot!

Dan