I'm currently using google sheets script editor to add a date to cell A2 when the value of B2 is edited.
How can I add a new column above if the auto input of A2 is the 1st da of the month?
Please see Screenshot.
The following is what I have now.
function onEdit(e){
var active = e.range;
//ADD DATE
if(active.getA1Notation().substring(0,1) == 'B' && SpreadsheetApp.getActiveSheet().getName() !== 'Inventory'){
if(active.isBlank()){
active.offset(0, -1).setValue("");
}else{
active.offset(0, -1).setValue(Date());
}
}
Any guidance on where I can proceed on from here will be good. Got no clues at all if this is even possible.


