作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图在条件连接公式中使用 getFontColor(),但谷歌表格不断抛出错误未知函数:'getFontColor'。怎么会这样?该功能在谷歌的文档中。
这是完整的公式:
=IF(getFontColor('DRAFT Compliance Spreadsheet'!B2)="#cc0000", CONCATENATE('DRAFT Compliance Spreadsheet'!B$1, ", "))
最佳答案
将此粘贴到您的脚本编辑器中并保存:
function getFontColor(cell) {
var rangeName = cell.split("!");
var sheet = rangeName[0].replace(/[^a-zA-Z0-9 ]/g, "");
var range = rangeName[1].replace(/[^a-zA-Z0-9 ]/g, "");
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName(sheet);
var fontColor = sheet.getRange(range).getFontColor();
return fontColor;
}
然后用这个替换你的公式:
=IF(getFontColor(CELL("address", 'DRAFT Compliance Spreadsheet'!B2))="#cc0000", CONCATENATE('DRAFT Compliance Spreadsheet'!B$1, ", "))
例子:
关于google-apps-script - 未知函数 : 'getFontColor' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68414551/
我试图在条件连接公式中使用 getFontColor(),但谷歌表格不断抛出错误未知函数:'getFontColor'。怎么会这样?该功能在谷歌的文档中。 这是完整的公式: =IF(getFontCo
本文整理了Java中org.apache.poi.xslf.usermodel.XSLFTextRun.getFontColor()方法的一些代码示例,展示了XSLFTextRun.getFontCo
我是一名优秀的程序员,十分优秀!