基本的なソリューションhttps://stackoverflow.com/a/4809413/1438650を見つけましたが、プロジェクトの条件付き側面と非連続側面の両方が欠けています。列 G の値に基づいてコピーを作成し、列 A、B、および H:S を他のスプレッドシートにコピーする必要があります。
function movePros() {
var date = Utilities.formatDate(new Date, "CST", "yyyy-MM-dd'T'HH:mm:ss'Z'") //"MM/dd/yyyy"
var source = SpreadsheetApp.getActiveSpreadsheet();
var target = SpreadsheetApp.openById("0ApBdJlRcFy9XdGx0aXRabWlweGxyY3czZzZIemVla3c");
var lastRow = source.getLastRow();
var sheet = source.getSheetByName("City");
var data = sheet.getDataRange.getValues(); //This makes an array, right?
Browser.msgBox(data.slice(1))
// I've tried, but still don't know how get at the individual cell values so that I can both check them and write them in the correct order which is different than the source
var prospect=[DateCalled,PriceSurvey,VolSurvey,Company,Phone,Contact,OdmNotes,Address,City,State,Zip,County,Sic,"","","","","","","","=IFERROR(IF(INDIRECT(\"W\"&ROW())<>\"\",TEXT(INDIRECT(\"W\"&ROW()),\"yyyyww\")+0,IF(INDIRECT(\"T\"&ROW())<>\"\",TEXT(INDIRECT(\"T\"&ROW()),\"yyyyww\")+0,IF(INDIRECT(\"A\"&ROW())<>\"\",TEXT(INDIRECT(\"A\"&ROW()),\"yyyyww\")+1,\"\"))),\"\")","U","","","","","",ODM,"",""];
// var prospect=[data()[0]..... ugh, I don/'t know....
/*
var ODM = sheet.getRange("A"+i).getValues();
var DateCalled = sheet.getRange("B"+i).getValues();
var PriceSurvey = sheet.getRange("H"+i).getValues();
var VolSurvey = sheet.getRange("I"+i).getValues();
var Company = sheet.getRange("J"+i).getValues();
var Phone = sheet.getRange("K1"+i).getValues();
var Contact = sheet.getRange("L"+i).getValues();
var OdmNotes = sheet.getRange("M"+i).getValues();
var Address = sheet.getRange("N"+i).getValues();
var City = sheet.getRange("O"+i).getValues();
var State = sheet.getRange("P"+i).getValues();
var Zip = sheet.getRange("Q"+i).getValues();
var County = sheet.getRange("R"+i).getValues();
var Sic = sheet.getRange("S"+i).getValues();
*/
while (i <= lastRow) {
var i = 2
if (sheet.getRange("G"+i).getValue()==1 && sheet.getRange("U"+i).getValue()=="") { //cheking
target.appendRow(prospect);
source.getRange("U"+i).setValue(date);
i++;
} else {
i++;
}
}
}