我需要将一个单元格从一个工作表复制到另一个工作表中的相应单元格
从这里:
到这里:
Please report back if this is not achieving what you require.
function updateVerified() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var source = ss.getRange('Calculates!D5:K').getValues();
var respSheet = ss.getSheetByName('Responses');
var respTs = respSheet.getRange('A2:A').getValues();
var respRange = respSheet.getRange('F2:F');
var respValues = respRange.getValues();
var convTs = [], temp;
for (var i = 0; i < respTs.length; i++) {
convTs[i] = respTs[i][0] ? respTs[i][0].getTime() : '';
}
for (var j = 0; j < source.length; j++) {
if (!source[j][0]) break;
temp = convTs.indexOf(source[j][0].getTime());
if (temp > -1) respValues[temp][0] = source[j][7];
}
respRange.setValues(respValues);
}