newish to Google Apps Script and typically tend to fall through it when I'm writing a script.
I have written the below script but it is aggressively inefficient. The app is run against over 2k rows of data in 5 columns trying to remove any rows where the cell contains a blank value.
This probably takes the code longer than it takes me manually so trying to find a way to make this more efficient.
Thanks in advance.
function process() {
var app = SpreadsheetApp;
var ss = app.getActiveSpreadsheet();
var mProSheet = ss.getSheetByName("MCC-Processed");
//Remove rows where column E is blank
var mProRange = mProSheet.getDataRange();
var mProRangVal = mProRange.getValues();
var deleteVal = '' //Delete value is blank
var deleteColumIdentifier = 4 //column E is 4th column (A=0)
for(var i = mccProRangVal.length-1; i >= 0; i--){
if(mccProRangVal[i][deleteColumIdentifier] === deleteVal){
mProSheet.deleteRow(i+1);
}
}
}