Forum Discussion
Office Scripts - How to use "RC" in a Script
Could you paste the script here please?
Hello,
Yes, my script (French) is :
function main(workbook: ExcelScript.Workbook) {
let conditionalFormatting: ExcelScript.ConditionalFormat;
let selectedSheet = workbook.getActiveWorksheet();
let range = workbook.getSelectedRange();
conditionalFormatting = range.addConditionalFormat(ExcelScript.ConditionalFormatType.custom);
const formula = '=EST.PAIR(LIGNE(LC))';
conditionalFormatting.getCustom().getRule().setFormula(formula);
conditionalFormatting.getCustom().getFormat().getFill().setColor("#e2eefa");
conditionalFormatting.setStopIfTrue(false);
conditionalFormatting.setPriority(0);
}
Formula in english should be : const formula = '=ISEVEN(ROW(RC))';
And the result is
=EST.PAIR(LIGNE('LC')) instead of =EST.PAIR(LIGNE(LC)) (the script adds quotes !?)
Thank you for your help,
Arnaud