Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 在Google工作表中对多个工作表大量应用条件格式_Google Apps Script_Google Sheets_Google Apps - Fatal编程技术网

Google apps script 在Google工作表中对多个工作表大量应用条件格式

Google apps script 在Google工作表中对多个工作表大量应用条件格式,google-apps-script,google-sheets,google-apps,Google Apps Script,Google Sheets,Google Apps,您好,我正在寻找一个脚本或一个拖放/点击功能,以便在多个工作表上批量应用条件格式 我所有的条件格式都在愿望表中 我想将条件格式应用于最多20张的其他工作表 在脚本中,我可以一次应用一张工作表或批量应用条件格式,因为我知道所有工作表名称。条件格式也属于格式,因此您可以使用copyFormatTo 因为你没有提供更多的信息 function copyFormatting() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var wishR

您好,我正在寻找一个脚本或一个拖放/点击功能,以便在多个工作表上批量应用条件格式

我所有的条件格式都在愿望表中

我想将条件格式应用于最多20张的其他工作表


在脚本中,我可以一次应用一张工作表或批量应用条件格式,因为我知道所有工作表名称。

条件格式也属于格式,因此您可以使用copyFormatTo

因为你没有提供更多的信息

function copyFormatting() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var wishRange = ss.getSheetByName("Wish").getDataRange();
  var targetSheetNames = ["Sheet1", "Sheet2"];

  targetSheetNames.forEach(function(sheetName) {
    wishRange.copyFormatToRange(
      ss.getSheetByName(sheetName), 
      wishRange.getColumn(), 
      wishRange.getLastColumn(), 
      wishRange.getRow(), 
      wishRange.getLastRow());
  });
};

条件格式也属于格式,因此您可以使用copyFormatTo

因为你没有提供更多的信息

function copyFormatting() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var wishRange = ss.getSheetByName("Wish").getDataRange();
  var targetSheetNames = ["Sheet1", "Sheet2"];

  targetSheetNames.forEach(function(sheetName) {
    wishRange.copyFormatToRange(
      ss.getSheetByName(sheetName), 
      wishRange.getColumn(), 
      wishRange.getLastColumn(), 
      wishRange.getRow(), 
      wishRange.getLastRow());
  });
};