+ Reply to Thread
Results 1 to 2 of 2

Google Sheets: Selective character case changing

  1. #1
    Registered User
    Join Date
    07-29-2021
    Location
    Melbourne, Australia
    MS-Off Ver
    10
    Posts
    1

    Google Sheets: Selective character case changing

    Does anyone know how to convert "selective" text or characters to lower or uppercase in Google Sheets? I know how to do it in Excel with a macro but have not been able to do it in Google Sheets.

    Example;

    I have an attendance sheet. People enter "w" if they worked. I want these entries to always be lowercase regardless of what case the user enters it in.

    In the same sheets I want "s" when entered to always be uppercase.

    Any help is greatly appreciated.

    Thanks,
    Mick.
    Last edited by AliGW; 07-30-2021 at 12:13 AM.

  2. #2
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Google Sheets: Selective character case changing

    Method 1: force the user to use the correct case

    1. Go to the menu Data > Data Validation in Google Sheets.
    2. Select the Range or column where you want all the entered texts to be in "UPPER" or "lower" case. The range for this example here is A1:A15.
    3. Select the Criteria "Custom formula is".
    4a. For "UPPER" case, enter the below formula.
    Please Login or Register  to view this content.
    4b. For "lower" case, enter the below formula.
    Please Login or Register  to view this content.
    5. Set other parameters: Select "Reject input" and "Show validation help text". Enter a message for "Show validation help text".
    DONE!

    Method 2: you select the range and then using an App Script that makes a new menu item for you, you switch the case as you need it

    1. Go to Tools > Script editor
    2. replace the basic code template with this code:
    Please Login or Register  to view this content.
    3. Click Save
    4. Click Run
    5. When prompted, click "Review Permissions"
    6. Select your google account and continue
    7. When prompted, click "Advanced"
    8. Click "Go to Change Case App (unsafe)"
    9. Click "Allow"
    10. Once the script has been run successfully, you can close the App Script window
    11. Reload the Google Sheet
    12. You should now see a new menu item called "Change Case", after Add-ons and Help.

    To use the feature, select the range you with to convert, then click "Change Case" and make your choice which case you want.

    Method 3: Setup Data Validation so users must make a selection from what is available, and can not enter whatever they want

    1. Go to Data > Data validation
    2. Select the "Cell range"
    3. Set Criteria to "List of items"
    4. enter each possible option exactly how you want it
    5. Select Reject Input
    6. Select "Show validation help text"
    7. Enter a suitable warning, like USE VALID SELECTIONS

    This has the effect that if the list has w,x,y,z... but the user enters a capital W, it will automatically convert to lowercase... also, the cell will reject anything that is not in the list of options that you set

    Method 4: using an App Script, this one automatically changes all entries, without warning, but unlike method 3, it allows users to enter any text they want

    1. Go to Tools > Script editor
    2. replace the basic code template with this code:
    Please Login or Register  to view this content.
    3. modify the variable to suit your needs:
    sheetName = 'Sheet1'; // The name of the sheet to affect
    colToChangeCase = 3; // The column number to affect: 1=A, 2=B, 3=C, etc, etc
    rowNumber = 2 // The starting row number
    4. UNcomment the correct row (UPPER or lower case) to suit your needs
    5. Save the script, but do not run it, it is not necessary to run it, running it will just give you an error and confuse you
    6. now go to your sheet and test data entry, for the above script it would be in cell C2, notice it will automatically convert to upper case, also, anything under it will also convert automatically
    Last edited by janmorris; 07-30-2021 at 08:30 AM. Reason: adding more methods to achieve similar results
    As a gesture off appreciation, you can click * Add Reputation at the foot of any of the posts of members who helped you reach a solution.

    And finally, was your problem solved? if so, please click Thread Tools above the first post of your enquiry, then select [Solved]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] send Reminder Email if cell value reached by selective case through outlook mail
    By Anisusa in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 06-09-2017, 03:32 PM
  2. [SOLVED] Selective changing of row numbers while dragging/copying a function (or another solution?)
    By eitatetaata in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-19-2015, 07:27 PM
  3. Changing all caps cell to 1st character cap and others lower case.
    By RoystonDick in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-29-2014, 02:38 PM
  4. Replies: 2
    Last Post: 04-18-2014, 04:12 PM
  5. Changing last character in a cell based on the character before it
    By Falcongbz in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 04-29-2013, 12:31 PM
  6. [SOLVED] Mass changing upper case to lower case letters
    By jonathan.haynes in forum Excel Formulas & Functions
    Replies: 28
    Last Post: 09-05-2012, 04:34 PM
  7. Changing Upper case to Proper Case
    By Mountain in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-13-2005, 07:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1