Quangqn76
Thành viên mới
- Tham gia
- 20/4/23
- Bài viết
- 2
- Được thích
- 0
function onEdit(e) {
var range = e.range;
var sheet = range.getSheet();
if (range.getRow() != 2 || range.getColumn() > 2) {
return;
}
if (range.getValue() == "") {
return;
}
var lastRow = sheet.getLastRow();
var targetColumn = range.getColumn();
if (targetColumn == 1) {
sheet.getRange(lastRow + 1, 1).setValue(range.getValue());
sheet.getRange(2, 2).activate();
} else {
sheet.getRange(lastRow + 1, 2).setValue(range.getValue());
sheet.getRange(2, 1).activate();
}
}
var range = e.range;
var sheet = range.getSheet();
if (range.getRow() != 2 || range.getColumn() > 2) {
return;
}
if (range.getValue() == "") {
return;
}
var lastRow = sheet.getLastRow();
var targetColumn = range.getColumn();
if (targetColumn == 1) {
sheet.getRange(lastRow + 1, 1).setValue(range.getValue());
sheet.getRange(2, 2).activate();
} else {
sheet.getRange(lastRow + 1, 2).setValue(range.getValue());
sheet.getRange(2, 1).activate();
}
}