Funny characters in text

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
 
K

Ken Snell \(MVP\)

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]
 

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