首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >向Google电子表格中的多个工作表添加新行的脚本。

问向Google电子表格中的多个工作表添加新行的脚本。
EN

Web Applications用户
提问于 2014-07-25 13:21:38
回答 1查看 1.8K关注 0票数 0

我想在Google电子表格中添加一个脚本,在包含多个电子表格的Google电子表格中的每个工作表的第二行中添加新行。

这种事每天都要发生。

EN

回答 1

Web Applications用户

发布于 2014-08-14 14:46:24

试试下面的代码:

代码语言:javascript
复制
function AddRow() {
  //gets the spreadsheet which it's bound to
  var ssheet = SpreadsheetApp.getActiveSpreadsheet();  

  //gets all sheets in this spreadsheet
  var sheet = ssheet.getSheets();                      

  //browses all the sheets, until "i" is larger than the number of sheets
  for (var i = 0; i < sheet.length; i++)               
  {
    //adds to the actual sheet a row AFTER the first row
    sheet[i].insertRowAfter(1);                        
  }
}

并每天触发(如凌晨1点)。

票数 1
EN
页面原文内容由Web Applications提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://webapps.stackexchange.com/questions/65740

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档