+ Reply to Thread
Results 1 to 7 of 7

Remove specific characters from cells with AppsScript coding

  1. #1
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21

    Question Remove specific characters from cells with AppsScript coding

    Hi, I'm a bit new to Javascript coding.
    I have a sheet called "Sheet1" where column "B2:B" (excluding the header) has strings made up of letters (uppercase and lowercase ones), spaces, numbers and symbols.

    I would like to make a script that takes the strings in column "B2:B" and:
    1. replaces all uppercases into lowercases;
    2. removes numbers, symbols (at the beginning, at the end, in the middle of the string);
    3. replaces spaces between words with dashes "-";
    4. removes spaces at the beginning or end of the string.

    After that, it should put the changed strings back into the right cells.

    I attach below an example image. In the photo, the corrected column is placed next to the original one (in D). This is just to show the action of the script.
    In the real sheet, the corrected strings must override the original ones in column "B2:B".

    Appreciate every help/solution given!


    Example.PNG
    Last edited by Micheal_Benton; 03-09-2023 at 02:44 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Remove specific characters from cells with AppsScript coding

    Are you tied to Java Script? or will you accept an alternate solution?

    If you are open to Power Query then

    Please Login or Register  to view this content.
    Last edited by alansidman; 02-23-2023 at 04:12 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Valued Forum Contributor
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (24 H2) 64 Bit
    Posts
    1,185

    Re: Remove specific characters from cells with AppsScript coding

    ...deleted....
    Last edited by Haluk; 02-24-2023 at 03:34 AM.

  4. #4
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21

    Re: Remove specific characters from cells with AppsScript coding

    Hi, thanks for the reply!

    Using AppsScript in Google Sheets, I'm tied to Javascript...

    Is that a problem? Would you still be able to help me?

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Remove specific characters from cells with AppsScript coding

    I have no skills with Java Script. Have you tried a Java Forum?

  6. #6
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21

    Re: Remove specific characters from cells with AppsScript coding

    ...deleted...
    Last edited by Micheal_Benton; 03-09-2023 at 02:42 PM.

  7. #7
    Registered User
    Join Date
    09-26-2022
    Location
    London, England
    MS-Off Ver
    Microsoft Office 365 2021
    Posts
    21

    Re: Remove specific characters from cells with AppsScript coding

    I've cross-posted this question over another forum: stackoverflow.com/questions/75583889/removal-of-characters-in-appsscript

    This question was solved there.
    Last edited by Micheal_Benton; 03-09-2023 at 02:43 PM.

+ 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. Replies: 7
    Last Post: 06-08-2021, 11:53 PM
  2. [SOLVED] Remove characters from cells if the have non data and characters as per attached sheet
    By khanaran in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-17-2019, 02:35 PM
  3. Create UDF that remove specific characters
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2017, 05:40 AM
  4. How to keep hyphen in a string and remove all specific characters
    By SunOffice in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-27-2013, 12:32 AM
  5. [SOLVED] VBA Remove Specific No.of Characters
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-22-2013, 05:39 AM
  6. Want to Remove A Non-Specific Text Strand Between Two Specific Characters
    By predictablepanda in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2013, 12:33 AM
  7. Formatting to remove specific characters
    By tisentes13 in forum Excel General
    Replies: 4
    Last Post: 10-13-2009, 04:34 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