I'm running 1 Master spreadsheet, with 4 product specific spreadsheets pulling info from it. If no relevant info is pulled, the smaller spreadsheets will display "no" in all cells. I want rows with "no" to be hidden.
I've sort of hacked together something, that sort of works. But I can't get it to work on all 4 sheets. I've tried getSheets(), I've tried getSheetByName(name) and naming all 4 sheets...it doesn't work.
Here's what I have so far:
function onOpen() {
var ss = SpreadsheetApp.getActive();
var sheets = ss.getSheets(); // array of all sheet objects in ss
var numSheets = ss.getNumSheets(); // count of sheets
//show all the rows
sheet.showRows(1, maxRows);
//get data from clumn C
var data = sheet.getRange('C:C').getValues();
//iterate over all rows
for(var i=0; i< data.length; i++){
//compare column, if no, then hide row
if(data[i][0] == 'no'){
sheet.hideRows(i+1);
}
}
}