This is fantastic and exactly what I am looking for. If you need to have a different range converted, specify that range in the second line of the macro. In this particular example, only text entered in cells A1:B10 will be converted everything else will be left as entered. If Not (Application.Intersect(Target, Range("A1:B10")) _ If you don't want everything converted, but only cells in a particular area of the worksheet, you can modify the macro slightly: Now anything (except formulas) that are entered into any cell of the worksheet will be automatically converted to uppercase.
Excel force uppercase in cell code#
In the code window for the worksheet, paste the above macro.(You may need to first open the VBAProject folder, and then open the Microsoft Excel Objects folder under it.) In the Project window, at the left side of the Editor, double-click on the name of the worksheet you are using.Display the VBA Editor by pressing Alt+F11.Private Sub Worksheet_Change(ByVal Target As Range)įor the macro to work, however, it must be entered in a specific place. The following macro can be used to convert all worksheet input to uppercase: When programming in VBA, you can force Excel to run a particular macro whenever anything is changed in a worksheet cell. Instead, you must use a macro to do the changing for you. For instance, if someone enters information in cell B6, then the worksheet function can't be used for converting the information in B6 to uppercase.
Excel provides a worksheet function that allows you to convert information to uppercase, but it doesn't apply as people are actually entering information. Now users will have no choice but to enter data correctly into the data set.If you are developing a worksheet for others to use, you may want them to always enter information in uppercase. That’s it all you need to do is test your data entry. In my example, I typed “Please Enter Detail In Upper Case!”
The Excel formula tip today is a recent favorite of mine at the moment, trying to get users to enter data in upper case only.
Hello Excellers, a warm welcome back to another #formulafriday blog post.