2017531
VBA Strings & Characters Builtin Constants
Builtin Constants Builtin constants are sometimes referred to as intrinsic constants. VBA.Constants
Chr
Comments
vbCr
Chr(13)
Carriage return character
vbLf
Chr(10)
Linefeed character
vbCrLf
Chr(13) + Chr(10)
Carriage return linefeed combination
vbNewLine
Chr(13) + Chr(10)
New line character
vbNullChar
Chr(0)
Character having a value of 0.
vbNullString
String having value 0
Not the same as a zerolength string (""); used for calling external procedures. Cannot be passed to any DLL's
vbTab
Chr(9)
Tab character
vbBack
Chr(8)
Backspace character
vbFormFeed
Chr(12)
Word VBA Manual manual page break ?
vbVerticalTab
Chr(11)
Word VBA Manual manual line break (Shift + Enter)
vbNullChar This constant can be used to test for a null character. This can also be used for assigning a null character to a string variable. The vbNullChar constant can be useful when passing string variables to external libraries that require a nullterminated string. This constant should be used instead of Chr(0).
vbNullString This constant can be used for assigning a zerolength string. This can also be used to test for empty strings. For all practical purposes using a zerolength string ("") is equivalent to using vbNullString. A zero length string means a string with no characters vbNullString is a constant used for a nullpointer and is more efficient than a zerolength string The following four lines are all equivalent. Dim myString As String myString = "" myString = vbNullString
http://bettersolutions.com/vba/stringscharacters/builtinconstants.htm
1/2
2017531
VBA Strings & Characters Builtin Constants
myString = vbNullString myString = Constants.vbNullString myString = VBA.Constants.vbNullString
http://bettersolutions.com/vba/stringscharacters/builtinconstants.htm
2/2