我需要修改以下脚本,以便仅将VALUES复制到另一个工作表而不是公式。谢谢!
function onEdit(event) {
// assumes source data in sheet named ClientList
// target sheet of move to named CLOSED
// test column with C is col 7 or G
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = event.source.getActiveSheet();
var r = event.source.getActiveRange();
if(s.getName() == "ClientList" && r.getColumn() == 7 && r.getDisplayValue() == "C1" || r.getDisplayValue() == "C2" || r.getDisplayValue() == "C3") {
var row = r.getRow();
var numColumns = s.getLastColumn();
var targetSheet = ss.getSheetByName("CLOSED");
var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
s.getRange(row, 1, 1, numColumns).copyTo(target);
s.deleteRow(row);
}
}
答案 0 :(得分:1)
如果我的理解是正确的,那么如何进行如下修改?
s.getRange(row, 1, 1, numColumns).copyTo(target);
s.getRange(row, 1, 1, numColumns).copyTo(target, {contentsOnly: true});
如果我误解了您的问题,请告诉我。我想修改它。