Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get (set) multiple text attributes in a single spreadsheet cell programmatically?

Since the introduction of the new spreadsheet version one can change text attributes inside a single cell (or merged cells) manually like in this example :

(left = raw text, right = formatted text, easier to read)

enter image description here

I don't see any way to achieve that by script... I don't see any issue nor feature request in the issue tracker either.

Is that possible ?

Every method I try to get the text attributes only returns a single value so I'm afraid I just can't do it... but who knows ?

like image 374
Serge insas Avatar asked Nov 15 '15 15:11

Serge insas


People also ask

How do I make multiple lines of text in one cell in Google Sheets?

Thankfully, you can – to type information into more than one line in a Google Sheets cell, click on the cell in question and type the first line of your content in. Then, press Alt + Enter on your keyboard (or Option + Enter if you use a Mac) to get to a new line.

How do I put multiple values in one cell in Google Sheets?

In the Google Sheets spreadsheet, select the cell where you want to create the SUM formula and display the cell values total. Type =SUM( to start creating the formula. Only enter the open (left) parenthesis and not the close (right) parenthesis yet. Select the cells containing the values you want to total.

Can you have multiple scripts in Google Sheets?

You can have multiple scripts in the same script file and you can have multiple script files as well. If you click on the small downward-facing arrow at the right of the Script file name, it will show you options to rename, delete, and create a copy of the script file.


1 Answers

On 2016, when this answer was originally posted, in Google Sheets was not possible to programatically apply formatting to cell content parts.

Please star the The following feature request on the Google Apps Scripts issues and feature requests official site is now fixed.

Issue 6000: Handle parts of cell content programmatically

According to the release notes of January 22, 2019 Google Apps Script was updated to include new classes and methods to handle cell content formatting like RichTextValue.

like image 122
Rubén Avatar answered Oct 14 '22 03:10

Rubén