Function Character Types Class

IsSpace

"Is Character Space" Return True if the character with ASCII value vCharCode is a "space" character; return False otherwise. The "space" classification include whitespace characters (Chr$(32) and Chr$(160)) and carriage control characters (carriage return, line feed, form feed, etc.).

Signature (Visual Basic / VBA)

Public Function IsSpace( _
    ByVal vCharCode As Integer _
    ) As Boolean

Code Example

    IsSpace(Asc(" ")) = True
    IsSpace(Asc(vbCr)) = True
    IsSpace(Asc(vbTab)) = True
    IsSpace(Asc("$")) = False

Parameters

Parameter Description
vCharCode Character whose ASCII value is checked to determine if it belongs to the "space" class.

Notes & Version History

Note Function will generate a runtime error if vCharCode is not between 0 (zero) and 255 inclusive.