Excel New Button Quick Change case

Source: Internet
Author: User
Tags lowercase

As you often know with friends in Word, you can easily change English characters ' uppercase ', ' lowercase ', ' first-letter ' and ' first-letter capitals ' in Word.

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:

Double-click the code to select all
1 2 3 4, 5 6 7 8 9 10 11 12 13 14 15

Sub 全部大写()           Dim itarget As Range             Set itarget = Selection          For Each ran In itarget           '将单元格内容转换为大写形式             ran.value = UCase(ran)          Next           End Sub



Right-click the All Lowercase button and enter the code:

Double-click the code to select all
1 2 3 4, 5 6 7 8 9 10 11 12 13 14 15

Sub 全部小写()          Dim itarget As Range            Set itarget = Selection         For Each ran In itarget          '将单元格内容转换为小写形式            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 converted to the size we want.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.