将表数据排序到谷歌脚本中的不同表格上

时间:2018-03-26 01:23:43

标签: google-apps-script

尝试使用关键字引用将文档中第一张纸的行复制到不同的纸张上。我使用下面的代码甚至我在我的日志中有相同的值它不会排序。请一些人请帮助

https://docs.google.com/spreadsheets/d/1rXlGPpTCZreDweJGCNil_OdCzeL9-uskw_DIRQsS0JU/edit?usp=sharing

function sortAndSeperate() {
 var i = 3;
 var days = 11;
 var ss = SpreadsheetApp.getActiveSpreadsheet()
 var d =ss.getSheetByName("Coming Up work").getRange(2, days );
 var sheet1 = ss.getSheetByName("Coming Up work");
 var worker = ss.getSheetByName("Reuben");
 var workerName =ss.getSheetByName('Setup').getSheetValues(1,1,1,6)
 Logger.log(workerName)
 var rangeMonday =sheet1.getSheetValues(i,11,1,6);
 Logger.log(rangeMonday)
 //var rangeTuesday=sheet1.getRange(row, column, numRows, numColumns)
 var worker = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Reuben");
 var copyrange = worker.getRange(i - 1, 1, 1, 10); 
 
 

  
if (rangeMonday == workerName ) {
var paste =SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Coming Up work").getRange(i,1,1,10).copyTo(copyrange)
var dateis = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Coming Up work").getRange(2 , days )
var paste2 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Reuben").getRange(i - 1,5)
var paste3 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Reuben").getRange(i - 1,6)
dateis.copyTo(paste2)
dateis.copyTo(paste3)
}
 else {
  Logger.log('It is finished.');
 }
  
}
}
} 

0 个答案:

没有答案