Funny characters in text

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I use the following code to insert lines of address text into an excel
sheet.

Dim MyXL As Object

Set MyXL = GetObject("C:\My Spreadsheet.xls")

MyXL.WorkSheets("Sheet1").Range("C7").Value = Me.Client & vbCrLf &
Me.[Client Address]

The problem is that on a client's pc the address shows funny boxes in
spreadsheet between address lines, I presume these are CRLF characters.
However on my PC I don't see them. Even when they send me a spreadsheet
which I can see by remotely login in has boxes, does not show boxes at my
end. What is the problem and how can it be fixed?

Thanks

Regards
 
ACCESS uses the carriage return + line feed characters (in combination) to
denote a new line. EXCEL uses just the line feed character to start a new
line. EXCEL doesn't see the carriage return + line feed characters (in
combination) as a "valid" new line, so you see the square box to represent
them. Therefore, change your code line to this:

MyXL.WorkSheets("Sheet1").Range("C7").Value = Me.Client & vbLf &
Me.[Client Address]
 
Back
Top