@ThinhDinh thank you. I changed your script to copy from col D all to col R like below:

function fillFormula() {

var ss = SpreadsheetApp.getActiveSpreadsheet();

var sheet = ss.getSheetByName(‘Transactions’);

var lr = sheet.getLastRow();

var fillDownRange = sheet.getRange(lr, 8, 1);

sheet.getRange(“H”+(lr-1)).copyTo(fillDownRange);

var fillDownRange = sheet.getRange(lr, 9, 1);

sheet.getRange(“I”+(lr-1)).copyTo(fillDownRange);

var fillDownRange = sheet.getRange(lr, 10, 1);

sheet.getRange(“J”+(lr-1)).copyTo(fillDownRange);

var fillDownRange = sheet.getRange(lr, 11, 1);

sheet.getRange(“K”+(lr-1)).copyTo(fillDownRange);

var fillDownRange = sheet.getRange(lr, 12, 1);

sheet.getRange(“L”+(lr-1)).copyTo(fillDownRange);

var fillDownRange = sheet.getRange(lr, 13, 1);

sheet.getRange(“M”+(lr-1)).copyTo(fillDownRange);

var fillDownRange = sheet.getRange(lr, 14, 1);

sheet.getRange(“N”+(lr-1)).copyTo(fillDownRange);

var fillDownRange = sheet.getRange(lr, 15, 1);

sheet.getRange(“O”+(lr-1)).copyTo(fillDownRange);

var fillDownRange = sheet.getRange(lr, 16, 1);

sheet.getRange(“P”+(lr-1)).copyTo(fillDownRange);

var fillDownRange = sheet.getRange(lr, 17, 1);

sheet.getRange(“Q”+(lr-1)).copyTo(fillDownRange);

var fillDownRange = sheet.getRange(lr, 18, 1);

sheet.getRange(“R”+(lr-1)).copyTo(fillDownRange);

}

Issue is it was looking good yesterday but today I see last row is empty from col D col R. even if I paste manually, it becomes empty after a few seconds. what should I do?