Search code examples
google-apps-scriptgoogle-sheets

How to trigger "hide" a row in Conditional Formatting/ Custom Rule


I am looking to remove (hide) a row from view if certain condition hits. How can this be accomplished, please?


Solution

  • Something like this

    function myFunction() {
      var sheet = SpreadsheetApp.getActiveSheet();
      var condition = true;
      if (condition) sheet.hideRow(sheet.getRange("A1"));
    }