Article ID: 169972
Article Last Modified on 11/10/2000
Constant Definition
-------------------------------------------------------------------
vbBack A backspace character [Chr(8)]
vbCr A carriage return [Chr(13)]
vbCrLf A carriage return and line feed [Chr(13) + Chr(10)]
vbLf A linefeed [Chr(10)]
vbNewLine A platform-specific new line character, either
[Chr(13) + Chr(10)] or [Chr(13)]
vbNullChar A null character of value 0 [Chr(0)]
vbNullString A string of value 0 [no Chr code]; note that this is
not the same as ""
vbTab A tab character [Chr(9)]
You can use these constants anywhere in Visual Basic code where you want
them to appear. For example, you can use them to display a multiline
message in a message box as in the following example:
MsgBox "Hello" & vbCr & "World!"
vbBack vbCr vbCrLf vbNewLine vbTab
ActiveCell.Value = "AAA" & vbNewLine & "BBB"
The cell displays the following value:
AAA[square character] BBB
ActiveCell.Value = "AAA" & vbNullChar & "BBB"
the cell displays only "AAA."
ActiveCell.Value = "AAA" & vbLf & "BBB"
the cell displays the value:
AAA
BBB
ActiveCell.Value = "AAA" & vbNullString & "BBB"
the cell displays the value:
AAABBB
MsgBox "AAA" & vbBack & "BBB"
the message box displays the message:
AAA[square character]BBB
Additional query words: XL97 square rectangle box
Keywords: kbprogramming kbcode KB169972