+ Reply to Thread
Results 1 to 5 of 5

SOLVED Help with Office Script to convert a Table to UPPER case

  1. #1
    Registered User
    Join Date
    08-30-2022
    Location
    Sydney, Australia
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (16.0.14326.21094) 64-bit
    Posts
    2

    SOLVED Help with Office Script to convert a Table to UPPER case

    Hi guys,

    I'm a complete noob so please bear with me. What I need is an office script (as this needs to be run from a Power Automate flow).

    I have a table which contains my data (which has been extracted by the flow).
    It's a requirement that the data is converted to UPPER case. This is what I'm stuck on.

    Please Login or Register  to view this content.
    This was created using the "Record" function in O365 Excel.
    1. I create a new worksheet.
    2. Target A1
    3. =UPPER(Extract) <-- name of table is Extract.
    4. I manually selected the cells that make up the table.
    5. Pasted values into original sheet (called Table) cell A2.
    6. Delete the temporary worksheet.

    It works... kinda! However, I need a way to only copy the cells that contain the UPPER data (from new worksheet). As you can see, it selects the range A1:AQ12 because at the time of recording, there were 12 rows and 43 columns.
    The number of rows is dynamic, sometimes it will be more than 12 or less. The number of columns is always going to be 43.

    What I'm looking for ultimately is for an office script that will replace the data in my main worksheet with UPPER case characters.
    And as I mentioned, it needs to be an office script as that's a function that can be run from Power Automate (this is an automation I'm building).

    Any help would be great.
    Last edited by xxxrob; 08-31-2022 at 11:02 PM. Reason: SOLVED

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Help with Office Script to convert a Table to UPPER case

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new here, I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: Help with Office Script to convert a Table to UPPER case

    I'm not sure this is fastest way but it works.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-30-2022
    Location
    Sydney, Australia
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (16.0.14326.21094) 64-bit
    Posts
    2

    Re: Help with Office Script to convert a Table to UPPER case

    This is brilliant. Works perfectly, total life saver.
    Thank you so much.

    I don't expect this of you and you've already done so much but for my learning, could you explain what it's doing in layman's terms for me?

    Is it basically, doing the row and column count to work out the "size" of the table.
    Then getting the values of the cells in that range
    Then if it's a string, converting it into UpperCase?

    This stuff melts my brain, but I find it so fascinating!

  5. #5
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    Re: SOLVED Help with Office Script to convert a Table to UPPER case

    Welcome, the Office Scripts docs are here. Check out the API reference. It has a lot of examples. There is also a lot of Excel samples. Converting to upper case is a Typescript/Javascript method. Just need to make sure it is a string since it can be a number. I've learned Typescript a while back since I wanted to do a React project. There is a good course on Udemy. It goes on sale all the time.
    Last edited by mogul; 09-01-2022 at 05:54 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. [SOLVED] Convert to Upper Case in Table
    By Craig Muir in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2017, 05:57 AM
  2. Replies: 7
    Last Post: 04-18-2014, 04:11 PM
  3. [SOLVED] Convert 1st letter of word to Upper Case and rest to lower case
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-23-2013, 11:44 AM
  4. [SOLVED] excel'03 how to convert a column from upper case to proper case
    By sharie palmer in forum Excel General
    Replies: 1
    Last Post: 01-30-2006, 07:55 PM
  5. [SOLVED] Convert lower case charecters to upper case
    By Dinesh in forum Excel General
    Replies: 3
    Last Post: 09-10-2005, 08:05 AM
  6. [SOLVED] Convert UPPER CASE to Lower Case?
    By Newbie in forum Excel General
    Replies: 6
    Last Post: 07-21-2005, 06:05 AM
  7. Replies: 1
    Last Post: 03-09-2005, 05: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