小编Cat*_*rus的帖子

Google SpreadSheets 获取单元格颜色

我在这个问题上浪费了一整天,还是没有解决。我到底如何创建一个返回指定单元格背景颜色的函数?如何获取函数参数的范围及其背景颜色?这是我尝试过的:

/**
 * Returns the Hexadecimal value of a cell's background color.
 * @param {cel} input The cell to get color.
 * @customfunction
 */
function getColor(cel) {
  var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange(cel);
  var background = ss.getBackground();
  return background;
 
}
Run Code Online (Sandbox Code Playgroud)

google-sheets-api

6
推荐指数
1
解决办法
8123
查看次数

标签 统计

google-sheets-api ×1