### VBA Upper, Lower, and Proper Case – Case Functions

While working in VBA, you often need to convert strings into lowercase, uppercase or proper case. This is possible by using the UCase, LCase and StrConv functions.

These functions are important when manipulating strings in VBA, as VBA is case sensitive. If you wish to make VBA case-insensitive, you need to add Option Compare Text at the top of your module. You can find out more about this here: Prevent VBA Case Sensitive

## UCase – Convert String to Upper Case

The UCase function in VBA converts all letters of a string into uppercase. There is only one argument, which can be a string, variable with string or a cell value. This function is often used if you want to compare two strings. Here is the code for the UCase function:

In the example, we want to convert all letters of the strText variable to upper case and assign the converted string to the strTextUCase variable. At the end we call the message box with the converted string: Image 1. Using the UCase function in VBA

## LCase – Convert String to Lower Case

If you want to convert all letters of a string into lower cases, you need to use the LCase function. This function has one argument, the same as the UCase. This is the code for the LCase function:

In this example, we convert all letters of the string from A1 into lower case. After that, the converted string is assigned to the cell A1. Image 2. Using the LCase function in VBA

## StrConv – Convert String to Proper Case

The StrConv function enables you to convert a string of text into proper case. The function has two arguments. First is the string that you want to convert. The second is the type of the conversion which you want. In order to convert a string to a proper case, you need to set it to vbProperCase. The code for the function is:

You will see on the example how the function works. It takes the string from the cell B1, converts it to proper case and returns the value in the cell A1. Image 3. Using the StrConv function in VBA

## StrConv – Convert String to Upper or Lower Case

Using the StrConv function, you can also convert a string to upper or lower cases. To do this, you just need to set the second argument to the vbUpperCase or vbLowerCase:

#### You may also like some of this related content...

VBA has many string functions that will allow you to manipulate and work with text
VBA Round The VBA Round Function rounds numbers to a specified number of digits. Syntax
Every character in Excel has an assigned number code to itself. The Chr function in
In this article, you will learn how to use the IsEmpty function in VBA to
The following UDF will return the formulae for a given cell reference: VBA Function to
{"ft_lang_label":"__label__en","ft_lang_prob":0.7209122,"math_prob":0.78495425,"size":2895,"snap":"2019-51-2020-05","text_gpt3_token_len":739,"char_repetition_ratio":0.18920788,"word_repetition_ratio":0.112840466,"special_character_ratio":0.22107081,"punctuation_ratio":0.0907441,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9522626,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,2,null,2,null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-24T03:17:58Z\",\"WARC-Record-ID\":\"<urn:uuid:a260f45d-5654-40a6-b73e-095c77cf22ef>\",\"Content-Length\":\"118045\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:99f0ff69-bf09-4042-a08e-d7bb9ae59e31>\",\"WARC-Concurrent-To\":\"<urn:uuid:7fb69528-0d16-4d1d-99a8-0d92badecb6e>\",\"WARC-IP-Address\":\"70.39.150.220\",\"WARC-Target-URI\":\"https://www.automateexcel.com/vba/upper-lower-proper-case-functions/\",\"WARC-Payload-Digest\":\"sha1:JLG5GI7CJHDRLOQALJY3XL57AGHUNDTM\",\"WARC-Block-Digest\":\"sha1:HXQU7CEZNOWMIJ5OFZQNPYFL5X2UCEB6\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579250614880.58_warc_CC-MAIN-20200124011048-20200124040048-00037.warc.gz\"}"}