Jul 30 2021 06:25 AM - edited Jul 30 2021 06:26 AM
When editing a string value in a cell, we could well use Alt+Enter to enter a newline.
However, when we write a string into a cell by JavaScript, newlines (i.e., `\n`) are ignored. I'm trying the following custom function, we see that what is displayed in the cell does not have newlines.
/**
* Test2
* @customfunction
* @param {number} a number
* @returns {string} the result
*/
function Test2(n) {
const xxx = "11111\n22222\t33333\r44444 55555"
console.log(xxx)
return xxx
}
Does anyone know how to enter newlines into a cell by JavaScript API? Is there any workaround?
Jul 30 2021 06:49 AM
SolutionHas 'Wrap Text' been turned on for the cell with the formula?
Jul 30 2021 06:49 AM
SolutionHas 'Wrap Text' been turned on for the cell with the formula?