【问题标题】:Script that highlights entire row after finding duplicate cells in column google在 google 列中找到重复单元格后突出显示整行的脚本
【发布时间】:2021-12-16 01:27:11
【问题描述】:

我试图弄清楚如何通过谷歌表格中的脚本制作一个按钮,该按钮将被按下当前活动的单元格,遍历整个单元格列以找到前一个活动单元格的副本,然后突出显示每个重复单元格所在的行。有什么想法吗?

【问题讨论】:

  • 我必须为我糟糕的英语水平道歉。不幸的是,我无法理解你的问题。我能问一下你当前的剧本问题和你的目标细节吗?
  • 请澄清您的具体问题或提供更多详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

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


【解决方案1】:
function myfunction() {
  const ss = SpreadsheetApp.getActive();
  const sh = ss.getActiveSheet();
  sh.getDataRange().setBackground("#ffffff");
  SpreadsheetApp.flush();
  const v = sh.getActiveRange().getValue();

  let lo = PropertiesService.getScriptProperties().getProperty('lastone');
  PropertiesService.getScriptProperties().setProperty('lastone', v);
  if (lo) {
    let tf = sh.createTextFinder(lo).matchEntireCell(true).findAll();
    tf.forEach(f => {
      sh.getRange(f.getRow(),1,1,sh.getLastColumn()).setBackground("#ffff00");
    });
  }
  SpreadsheetApp.flush();
}

【讨论】:

  • PropertiesService.getScriptProperties().getProperty()绕过时间限制?
  • @YuriKhristich 我想有一点,但我不知道它是什么。
猜你喜欢
  • 2022-11-03
  • 1970-01-01
  • 1970-01-01
  • 2020-10-07
  • 1970-01-01
  • 1970-01-01
  • 2021-12-26
  • 1970-01-01
  • 2019-07-02
相关资源
最近更新 更多