Set format as plain text

六眼飞鱼酱① 提交于 2019-12-04 07:21:07

问题


function A1format() {
 var ss = SpreadsheetApp.getActiveSpreadsheet();
 var mainsheet = ss.getSheetByName("Sheet1");
 var G = mainsheet.getRange("C15:BH3000").getGridId();
 var illa = mainsheet.getRange("A13");

 Logger.log(G);
 illa.copyFormatToRange(G, 16, 3,200, 30);
 }

This doesnt Work and gives some strange Server error. Please help


回答1:


ldo Green answer above is right : in your code the end row is smaller than the start row...(columns are wrong too but it strangely accept this small negative difference) this is indeed not valid.

Using the autocomplete feature in the editor will remind you the parameters as follows :




回答2:


It seems that your col, colEnd and row, rowEnd values are not valid. The format of the copyFormatToRange function is:

copyFormatToRange(gridId, column, columnEnd, row, rowEnd)

// So in your case: column, columnEnd, row, rowEnd
copyFormatToRange(G,   3,      16,      30, 200);

If it's not helping - please add more details about the errors you are getting and make sure that the gridId is correct.



来源:https://stackoverflow.com/questions/26073939/set-format-as-plain-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!