简体   繁体   中英

How do I delete every row besides row 1 in google spreadsheets using google scripts?

我正在尝试擦除除第 1 行之外的每一行,但我不知道如何

All rows in all sheets of Spreadsheet except row 1

function delrow2plusallsheets() {
  const ss = SpreadsheetApp.getActive();
  ss.getSheets().forEach(sh => {
    let mr = sh.getMaxRows();
    sh.deleteRows(2,mr - 1)
  });
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM