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?

2 Answers

Something like this

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

Google Sheets does not support hiding rows using a conditional formatting rule. What you can do is to hide values by using conditional formatting to set the text color of their cells to white (or whatever the cell fill color happens to be).

To hide rows, you will need a script. You may want to look into an onEdit(e) simple trigger that runs automatically when you hand edit the spreadsheet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest