vbcrlf question

  • Thread starter Thread starter Gary Keramidas
  • Start date Start date
G

Gary Keramidas

i use vbcrlf when i create a label in a cell.
anyone know why i don't see the non-printable character (box) in the cell but when i
run the code at my client's site, the box is visible?
 
They might be using Excel XP. Try Chr(10) or Chr(13) instead.

If that's not working, try it with replacing:

Worksheets("Sheet1").Range("A1").Replace _
What:=vbCrLf, Replacement:=Chr(10)

Hubisan
 
Hi Gary,

I am a bit confused by what you mean by a "label in a cell". Do you mean
simply text in a cell where the text is wrapped and includes a line feed? If
so, use vbLf in lieu of vbCrLf. vbLf is the same character that is inserted
when you use Alt/Enter in the interactive mode to insert a line feed in a
cell.
 
If you really use vbcrlf in a cell, you should see either:
two boxes (if wordwrap is turned off)
or
a box (vbcr) and a second line (caused by the vblf).

Are you sure you're using vbcrlf?

ps. I don't use a Mac so I don't know how those are treated on that platform.
Are you both using PCs?
 
yes, i'm sure i am using vbcrlf. not using any mac's. i want the text for the label
on 3 lines in the cell, so i used vbcrlf. at my client's site, the label text is on
3 lines, there are just boxes at the end of the first and 2nd line. don't some up on
mine.

i sent them new code yesterday that used chr(10) but have not heard back from them,
to see if it still shows the box. not sure if they are using office xp yet.
 
If you used vbcrlf, you should see the box character, too.

And you could use vblf instead of chr(10). That constant is built into excel
and (I think) is easier to read/understand for most people.
 
Back
Top