As you often know with friends in Word, you can easily change English characters ' uppercase ', ' lowercase ', ' first-letter ' and ' first-letter caps ' in Word (Figure 1).
Computer Tutorials
However, these features Excel do not have, if you want to use these features in Excel, you must manually modify or use complex formulas for conversion. In fact, we can write related macros to solve this problem once and for all.
First draw four command buttons to change the text on the button to "all caps", "all lowercase", "uppercase" and "uppercase". Then write the corresponding macro code for each button individually.
For example, "All Caps" button, enter the code:
Code fragment:
Sub All caps ()
Dim ITarget as Range
Set ITarget = Selection
For each ran in ITarget
' Convert cell contents to uppercase
Ran.value = UCase (RAN)
Next
End Sub
Right-click the All Lowercase button and enter the code:
Sub all lowercase ()
Dim ITarget as Range
Set ITarget = Selection
For each ran in ITarget
' Converts cell contents to lowercase
Ran.value = LCase (RAN)
Next
End Sub
The button is ready to use when you have completed the above operation. Select the target cell range and click the corresponding conversion button, and the selected English character is immediately converted to the size we want (Figure 2).