【问题标题】:Get row and column value of a cell which has a note in Google Spreadsheet获取在 Google 电子表格中有注释的单元格的行和列值
【发布时间】:2018-08-22 17:29:40
【问题描述】:

我需要获取电子表格中有注释的单元格的行号和列号。有一种方法可以获取电子表格中的所有 cmets 或注释,但我想获取该单元格的行和列索引而不是它的注释。

【问题讨论】:

    标签: google-apps-script google-sheets google-sheets-api


    【解决方案1】:

    range.getNotes() 返回指定范围的二维数组。假设范围是 getDataRange() 然后在数组中搜索您感兴趣的注释

        var notes = sheet.getDataRange().getNotes();
        for( var i=0; i<notes.length; i++ ) {
          for( var j=0; j<notes[0].length; j++ ) {
            if( notes[i][j] === note ) {
              Logger.log("row = "+(i+1)+" col = "+(j+1));
              return;
            }
          }
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-28
      • 2020-03-08
      • 1970-01-01
      • 1970-01-01
      • 2014-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多