inselberg
inselberg

Reputation: 959

How do i set now() on column change?

How can i set the current timestamp NOW(), p.e. in A1, if i change a value in a column (A2-A100).

It s imported that the timestamp stays unchanged as long nothing is changed.

Upvotes: 0

Views: 101

Answers (1)

JPV
JPV

Reputation: 27242

You will have to use a google apps script for that. Consider below script as an example: it 'stamps' cell A1 (of sheet1) when edits are made in Col A (of sheet1) Change the sheet name, paste it in the script editor and try doing some edits in col A to see if the stamp appears (format cell A1 as date or date/time as you wish). Do not try to run this script from the script editor..

function onEdit(e) {
var sheetName = 'Sheet1'; //name of the sheet the script should work on 
var colToWatch = 1 // columnn of the edits
var stampCell = 'A1'; 
if (e.range.columnStart !== 1 || e.source.getActiveSheet()
    .getName() !== sheetName || e.range.rowStart ===1) return;
e.source.getActiveSheet()
    .getRange(stampCell)
    .setValue(e.value ? new Date() : null);
 }

Upvotes: 1

Related Questions