VBA – Force Proper, Upper, or Lower case automatically

Do you need to automatically change a cells text to Proper, Upper, or Lower case after the user enters it? There are multiple way to accomplish this, and multiple requirements possible. Here is an example that automatically changes everything after it’s entered in a particular column. Hopefully you can build from this example!

1. Press ALT and F11 to open the code window

2. Double click the sheet name you want to automatically

change case

3. Put this code in the code window:

Change Text to Proper Case

Code for Proper case

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

Application.EnableEvents = False

If Target.Column = 5 Then

Target = StrConv(Target, vbProperCase)

End If

Application.EnableEvents = True

End Sub

Change Text to Upper Case

For Upper case you can change

StrConv(Target, vbProperCase)



Change Text to Lower Case

For Lower case you can change

StrConv(Target, vbProperCase)



VBA Coding Made Easy

Stop searching for VBA code online. Learn more about AutoMacro – A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!

alt text

Learn More!

<<Return to VBA Examples

VBA Code Examples Add-in

Easily access all of the code examples found on our site.

Simply navigate to the menu, click, and the code will be inserted directly into your module. .xlam add-in.

(No installation required!)