I have the following function that works to search for a column line by line and hides a row when it finds x. It works but is slow.
function SummaryViewGenerate() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var lastRow = sheet.getLastRow();
for( i=1 ; i<=lastRow ; i++) { // i <= lastRow
var status = sheet.getRange("K"+i).getValue();
if (status == "x") { // status == "x"
sheet.hideRows(i);
}
}
}
The problem is that it is super slow for my use. Any idea on how I can improve it. Someone mentioned on another thread about putting it into an array. Im still a coding newbie so any help in the right direction would be useful.