Hiding Row
Hello all,
I have a function called onEdit(e), and it works perfectly except for when I attempt to hide a row. The code is below:
function onEdit(e){
let sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
// event variables
let range = e.range;
let row = e.range.getRow();
let col = e.range.getColumn();
let cellValue = sheet.getActiveCell().getValue();
let status = sheet.getRange(row,5).getDisplayValue();
if ( col == 5 && cellValue != 'Problem' && cellValue != 'Not Started') {
MailApp.sendEmail(email info, this part works);
if (status == 'Completed') {
Utilities.sleep(7000);
sheet.hideRows(row);
};
};
}
This is not working, regardless of whether I include the Utilities.sleep command, use sheet.hideRows or sheet.hideRow, or put the command inside or outside the nested if statement.
Any guidance?
u/jt_ftc_8942 — 7 days ago