As someone who is fairly new to incorporating scripts in Google Sheets, I stumbled upon this straightforward and beneficial code snippet online. My objective is to conceal rows within a specified range (rows 10 - 34) where there are blank cells in column E. Despite being confident in the code provided, it appears to be hiding all rows within the range irrespective of whether there is content in column E.
I have experimented with the following:
data[i][3] = 'null',
data[i][4] = 'null',
data[i][5] = 'null'
Can anyone pinpoint where I might be making a mistake?
Any assistance would be greatly appreciated.
function filterRows() {
var sheet = SpreadsheetApp.getActive().getSheetByName("Print Client Report");
var data = sheet.getDataRange().getValues();
for(var i = 9; i < 34; i++) {
//If column E (5th column) is "Y" then hide the row.
if(data[i][3] = 'null') {
sheet.hideRows(i + 1);
}
}
}