如果我的理解是正确的,那么这个答案呢?请认为这只是几个答案之一。
在此答案中,我使用了Sheets API的“ updateDimensionProperties”。使用此脚本时,请在高级Google服务中启用Sheets API。
function myFunction() {
var height = 200; // Please set the height as the unit of pixel.
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Sheet1"); // or ss.getActiveSheet()
var resource = {requests: [{
updateDimensionProperties: {
properties: {pixelSize: height},
range: {sheetId: sheet.getSheetId(), startIndex: 2, endIndex: 3, dimension:"ROWS"},
fields:"pixelSize"
}}]};
Sheets.Spreadsheets.batchUpdate(resource, ss.getId());
}
startIndex: 2, endIndex: 3
表示第3行。dimension
为COLUMNS
。如果我误解了您的问题,而这不是您想要的方向,我深表歉意。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句