it works when "config!a2" & "config!b2" is only the range I set but is it possible to get the values of "config!a2:a" & "config!b2:b"
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "raw" ) {
var r = s.getActiveCell();
var watchColumn = s.getRange('config!A2').getValues();
var dateColumn = s.getRange('config!B2').getValues();
var watchColumn1 = s.getRange('config!A3').getValues();
var dateColumn1 = s.getRange('config!B3').getValues();
if( r.getColumn() == watchColumn ) { //checks the column
var nextCell = r.offset(0, (dateColumn)-watchColumn);
if( nextCell.getValue() === '' || nextCell.getValue() != '')
nextCell.setValue(new Date());
}
if( r.getColumn() == watchColumn1 ) { //checks the column
var nextCell = r.offset(0, (dateColumn1)-watchColumn1);
if( nextCell.getValue() === '' || nextCell.getValue() != '')
nextCell.setValue(new Date());
}
}
}