如果上一列包含cell =" X"

时间:2016-11-15 11:51:11

标签: google-apps-script google-sheets

到目前为止,我在谷歌脚本编辑器中有两个功能 - 第一个工作,第二个不工作。

       function HideColumn() //trigger is set to open

      {
       var ss = SpreadsheetApp.getActiveSpreadsheet();
       var s = ss.getSheetByName("Sheet 1");

       var datarange = s.hideColumns(34); //this will hide Column AH
      }




      function unHideColumn() //trigger is set to edit

    { 
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var sheet = ss.getSheetByName("Sheet 1");
      var range = sheet.getRange("AG2");


     {

     if (range === ("14. Ineliglble")) sheet.unhideColumn("AH");

      }
     }

链接到工作表:https://docs.google.com/spreadsheets/d/1DJTmKqaiYWdeoNxTWIawTE-nzI_mcIdbq9VEiCJz6OM/edit?usp=sharing

1 个答案:

答案 0 :(得分:0)