Google Apps Script Text rotation

2019-02-25 18:44发布

I found in the UI of Google Spreadsheet the functionality Text Rotation but i found no equal function in google apps script.

So how can i rotate Text with Google apps script?

Regards

Edit: I created a Spreadsheet with the needed rotation as default setting after this a make a copy of this spreadsheet.

1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-02-25 19:10

You may follow the formula given in this thread. Here's a sample code:

function myFunction() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var cell = sheet.getRange(1,1);
  cell.setValue('=ARRAYFORMULA(CONCATENATE((MID($B2, ROW(INDIRECT("YY1:YY"&LEN($B2))), 1)&CHAR(10))))');
}

In this example, we'll set the value of B2 in A1 in vertical format. Hope this helps.

查看更多
登录 后发表回答