VBA code: Force text string to uppercase Private Sub Worksheet_Change(ByVal Target As Range)ģ. Then choose your used worksheet from the left Project Explorer, double click it to open the Module, and then copy and paste following VBA code into the blank Module: Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.Ģ. With the following VBA code, when you enter the lowercase words into a cell, the lowercase text will be changed to the uppercase letters automatically.ġ. If you need to force the text strings to lowercase or proper case, please apply the following formulas into the Data Validation in step 2.įorce to lowercase: =EXACT(LOWER(A1),A1) įorce to proper case: =EXACT(PROPER(A1),A1) And then click OK to close the dialog, now when you enter the text string not in uppercase in column A, a warning box will pop out to remind you entering the uppercase letters. Then you can create an alert as you need, please click Error Alert tab, and select Stop from the Style drop down list, at the right corner of the Error message text box, enter your own warning message, see screenshot:Ĥ. In the Data Validation dialog, under the Settings tab, click the Allow drop down list and choose Custom option, then in the Formula text box, enter this formula =EXACT(UPPER(A1),A1), ( A1 stands for a column that you will apply this feature, you can change it to your need ), see screenshot:ģ. Go to click Data > Data Validation > Data Validation, see screenshot:Ģ. In this article, I will introduce some interesting ways to force the text to uppercase, lowercase or proper case as you need.įorce the text strings to uppercase / lowercase / proper case with Data Validationįorce the text strings to uppercase / lowercase / proper case with VBA codeĬhange text to UPPERCASE/lowercase/Proper Case with Kutools for Excelĭata Validation is a powerful tool in Excel, it can help us to do many operations, with its help, we can also force the uppercase, lowercase or proper case of the text strings when typing, please do as follows:ġ. Most of us may consider the Data Validation feature in Excel, with this function, we will get a warning when we don’t type the correct case of the text. In Excel, when you enter some letters or words into the cells, you want to force the text strings to uppercase even though you entered the lowercase or proper case letters and vice versa. How to force text string to uppercase / lowercase / proper case in Excel?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |