简体   繁体   中英

How to hide row when value of one of the cell in row is “yes”?

I have this function

function HideRow()
{
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var s = ss.getSheetByName("Sheet1");

  var datarange = s.hideRows(2);//this will hide Column B
}

But i don't know how to use this function HideRows() with checking value of one of the cell in the row to "yes". Could someone explain me?

You could use the QUERY formula to achieve this.

Please post a Sheet with Dummy Data so we can show you how to use it.

In the meantime, as a generic example:

=Query(A:Z; "Select A,B,C...Z Where X='YES'";1)

A:Z is the range

Select A,B,C...Z are the columns for the rows you wish to hide

WHERE X='YES' this is the condition that will hide the row.

Cheers,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM