Function Character Types Class

EveryCharacterWithinRange

"Every Character Within ASCII Range " Create a string containing every character whose ASCII value is within the specified range.

Signature (Visual Basic / VBA)

Public Function EveryCharacterWithinRange( _
      Optional ByVal vFromAsc As Variant _
    , Optional ByVal vThruAsc As Variant _
    ) As Variant

Code Example

    EveryCharacterWithinRange(65, 70) = "ABCDEF"
    EveryCharacterWithinRange("A", "F") = "ABCDEF"
    EveryCharacterWithinRange(34, 25) = "" ' #3

Parameters

Parameter Description
vFromAsc The lower limit of the range of ASCII values. Note: Special argument fix-up code. vFromAsc defaults to 0 (zero) if it is missing, Null, or an empty string. If vFromAsc is a string, then the ASCII value of the first character is used as the lower limit. If vFromAsc is numeric (and not a numeric string), then that number is used as the lower limit.
vThruAsc The upper limit of the range of ASCII values. Note: Special argument fix-up code. vThruAsc defaults to 255 if it is missing, Null, or an empty string. If vThruAsc is a string, then the ASCII value of the first character is used as the upper limit. If vThruAsc is numeric (and not a numeric string), then that number is used as the upper limit. Function returns an empty string if the lower limit vFromAsc is greater than the upper limit vThruAsc as in example #3.