function trailerDelete(e) { //This is the onChange(e) trigger
var app = SpreadsheetApp;
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var targetSheet = app.getActiveSpreadsheet().getSheetByName(“Report”);
// You can replace “Report” in the above line, to the sheet that you are referencing.
//Logger.log(targetSheet.getRange(2, 2).getValue() + " Test");
if (e.changeType==“EDIT”){
for (var i = 2; i < 6;i++){
if (targetSheet.getRange(i,2).getValue() ==""){
targetSheet.getRange(i, 3).clear();
targetSheet.getRange(i, 4).clear();
targetSheet.getRange(i, 5).clear();
// The 3 examples above are the columns and corresponding row that need to be //deleted
}
}
}
}
The example above is what I use to clear a set of values when I check to see if a cell is empty. It iterates through my entire sheet.
I must tell you that the script can take time to run depending on the size of your sheet and how much data you are trying to edit. Also, there is the Glide/Google lag if your account is not pro.