TOP

VBA Function: LCase

Description

The VBA LCASE Function converts a character string to lowercase.


LCASE Syntax

LCase(text)

VBA LCase Example

Using the LCase Function to convert a string to lowercase:

Sub LCaseExample1()
    
    text = "Example@MOONEXCEL.com.ua"
    
    text = LCase(text)
    
    MsgBox text 'Returns: example@moonexcel.com.ua
    
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."
     Else
         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.