I am trying to delete specific rows containing specific string "X".
function deleteRows() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = ss.getSheetByName('delete containing');
var r = s.getRange('A:A');
var v = r.getValues();
for(var i=v.length-1;i>=0;i--)
if(v[0,i]=='Substitution: ')
s.deleteRow(i+1);
};
But I am getting below error:
TypeError: Cannot call method "getRange of null.(line 4, file "Code").
Can Anybody help me resolving this error? Thank you