Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140101

Loop that will look for and delete particular row in Google Sheets script

$
0
0

I want to make loop in google sheets scripts that will in a first place get position of every row where on column B is "N/A" error and then delete the whole row. I start with that code but it doesn't return me the row of "N/A" string.

  function DeleteShops() {

  var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("MainShops");

  for(i=4; i < 282; i++){

  var RowCheck = ss.getRange(i, 2).getValues();

    if (RowCheck ===  "#N/A") {

   var RowToDelete = ss.getRange(i, 2).getRow();
       break;  

    } 

    else {

      continue;

         }

  }

   Logger.log(RowToDelete);

}  


Viewing all articles
Browse latest Browse all 140101

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>