Google Apps脚本文字旋转 [英] Google Apps Script Text rotation
本文介绍了Google Apps脚本文字旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Google Spreadsheet的用户界面中发现了文本旋转的功能,但在Google应用脚本中找不到相同的功能。
所以,如何将文本与Google应用程序一起旋转脚本?问候
编辑:我创建了一个Spreadsheet,这个电子表格的一个副本。
您可以按照线程。这里有一个示例代码:
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)))) );
$ b 在这个例子中,我们将A1中的B2的值设置为垂直格式。希望这有助于。
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.
解决方案 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.
这篇关于Google Apps脚本文字旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文