How can I add an empty cell using Google Apps Script? Lets say I find a given value in a cell and I wan't to add an empty cell below or above it.
Also, how can I change the color of a substring inside a cell? Lets say my string is: TTP'112'223 , and I want the bold number in red: TTP'112'223
So far I haven't found any example on how to do this, thats why I don't have any initial code.
Thanks for your help.
EDIT:
For changing text style of a substring this example helped me:
// Sets all cells in range B2:D4 to have the text "Hello world", with
"Hello" bolded.
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("B2:D4");
var bold = SpreadsheetApp.newTextStyle()
.setBold(true)
.build();
var richText = SpreadsheetApp.newRichTextValue()
.setText("Hello world")
.setTextStyle(0, 5, bold)
.build();
range.setRichTextValue(richText);
https://developers.google.com/apps-script/reference/spreadsheet/range#setrichtextvaluevalue