![](/img/trans.png)
[英]Google Script: How to copy and paste range to a new sheet on a row that is not empty
[英]google script copy data from sheet 1 to first empty row sheet 2
function copy() {
const ss = SpreadsheetApp.getActive();
const sh = ss.getSheetByName('Sheet1')
const rg = sh.getActiveRange();//you select the range before running the script
const vs = rg.getValues();
const tsh = ss.getSheetByName('Sheet2');
tsh.getRange(tsh.getLastRow() + 1, 1,vs.length,vs[0].length).setValues(vs);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.