셀 값을 기반으로 행을 복사하려면이 관련 SO post 또는 post2.
function copy2(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sh = SpreadsheetApp.setActiveSheet(ss.getSheets()[0]); selects the first sheet in your spreadsheet
var data=sh.getDataRange().getValues();// data is a 2D array, index0 = col A
// so column k is index 10
var target=new Array();// this is a new array to collect data
for(n=0;n<data.length;++n){ // iterate in the array, row by row
if (data[n][10]=="Done In The Past 30 Days"){ ;// if condition is true copy the whole row to target
taget.push(data[n]);// copy the whole row
}
}
if(target.length>0){// if there is something to copy
var sh2=SpreadsheetApp.setActiveSheet(ss.getSheets()[1]); //second sheet of your spreadsheet
sh2.getRange(1,1,target.length,target[0].length).setValues();// paste the selected values in the 2cond sheet in one batch write
}
}
당신은 sheetID 당 각 사본을 제한하는 카운터를 추가 할 수 있습니다 : 여기
포스트에서 코드입니다.
희망이 도움이됩니다.
단순히 피벗 차트를 사용해 보셨습니까? – OblongMedulla