The VBA LCase Function

Related Function:


The VBA LCase function converts a supplied String into lower case text.

The syntax of the function is:

LCase( String )

Where the String argument is the text string that you want to convert to lower case.

VBA LCase Function Example

In the following example, the VBA LCase function is used to convert the String "John Paul Smith, DOB 11/12/1982" to lower case text.

' Convert a string to lower case text.
Dim str1 As String
str1 = LCase( "John Paul Smith, DOB 11/12/1982" )
' The variable str1 is now equal to "john paul smith, dob 11/12/1982"

After running the above VBA code, the variable str1 is equal to the String "john paul smith, dob 11/12/1982".

Note that the LCase function leaves punctuation and numbers unchanged.