VBA Function: LCase


The VBA LCASE Function converts a character string to lowercase.

LCASE Syntax


VBA LCase Example

Using the LCase Function to convert a string to lowercase:

Sub LCaseExample1()
    text = ""
    text = LCase(text)
    MsgBox text 'Returns:
End Sub

Using the LCase function to check if a string is lowercase:

Sub LCaseExample2()
     nickname = "Treecher_21"
     'Test if the nickname is equal to its value converted to lowercase
     If nickname = LCase(nickname) Then
         MsgBox "Yes, the nickname is lowercase."
         MsgBox "No, the nickname contains capital letters." 'Display this result
     End If
End Sub
The inverse function that converts to uppercase is the UCASE function.