Function Character Types Class

SwapUpperAndLowerCase

Replace all lower-case alphabetic characters with their upper-case equivalent, and replace all upper-case characters with their lower-case equivalent.

Signature (Visual Basic / VBA)

Public Function SwapUpperAndLowerCase( _
    ByVal vValue As Variant _
    ) As Variant

Code Example

    SwapUpperAndLowerCase("ABC abc 123 !@#") = "abc ABC 123 !@#"
    SwapUpperAndLowerCase("abc 123 ABC !@#") = "ABC 123 abc !@#"

Parameters

Parameter Description
vValue The string containing the characters whose "case" is to be swapped. Function returns Null if vValue is Null or cannot be fixed up to a String.

Notes & Version History

Note Function only works for characters in the ANSI Windows character set because it uses the built-in Visual Basic LCase$() and UCase$() functions.