Home > database >  Filter & Delete rows of data based off of column value fast! (Google Sheets)
Filter & Delete rows of data based off of column value fast! (Google Sheets)

Time:07-07

Is there a way to filter the data in column Q off my google sheet faster then reading line one by one. There is daily about 400 lines it needs to scan through and I need to delete every row of data if the data in column Q is less than 1 right now watching it, it takes about 10 minutes.

  function UpdateLog() {

  var returnSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('CancelRawData');
  var rowCount = returnSheet.getLastRow();

  for (i = rowCount; i > 0; i--) {
    var rrCell = 'Q'   i;
    var cell = returnSheet.getRange(rrCell).getValue();
    if (cell < 1 ){
      returnSheet.deleteRow(i);
    }
  }
  {

SpreadsheetApp.getUi().alert("           
  • Related