COORECT AND EXTEND THE CURRENT CODE function addTimestamp4(e) { const timestampCols = […
- User
COORECT AND EXTEND THE CURRENT CODE function addTimestamp4(e) {
const timestampCols = [ { col: 2, cell: "B4" },{ col: 4, cell: "D4" },{ col: 6, cell: "F4" },{ col: 8, cell: "H4" },{ col: 10, cell: "J4" },{ col: 12, cell: "L4" },{ col: 16, cell: "N4" },{ col: 18, cell: "P4" },{ col: 20, cell: "R4" },{ col: 22, cell: "T4" } ];
const ws = "المشموم - القسط الهندي"; const row = e.range.getRow(); const col = e.range.getColumn();
if (e.source.getActiveSheet().getName() === ws) { const currentDate = new Date(); timestampCols.forEach(function (timestampCol) { if (col === timestampCol.col && row >= 6) { const cellValue = e.source.getActiveSheet().getRange(timestampCol.cell).getValue(); if (cellValue === "") { e.source.getActiveSheet().getRange(timestampCol.cell).setValue(currentDate); } } }); } }
- Assistant
function addTimestamp4(e) {
- User
ADD 10 COLUMNS TO THE CODEfunction addTimestamp4(e) {
const timestampCols = [ { col: 2, cell: "B4" },{ col: 4, cell: "D4" },{ col: 6, cell: "F4" },{ col: 8, cell: "H4" },{ col: 10, cell: "J4" },{ col: 12, cell: "L4" },{ col: 16, cell: "N4" },{ col: 18, cell: "P4" },{ col: 20, cell: "R4" },{ col: 22, cell: "T4" } ];
const ws = "المشموم - القسط الهندي"; const row = e.range.getRow(); const col = e.range.getColumn();
if (e.source.getActiveSheet().getName() === ws) { const currentDate = new Date(); timestampCols.forEach(function (timestampCol) { if (col === timestampCol.col && row >= 6) { const cellValue = e.source.getActiveSheet().getRange(timestampCol.cell).getValue(); if (cellValue === "") { e.source.getActiveSheet().getRange(timestampCol.cell).setValue(currentDate); } } }); } }
- Assistant