作成日: 2021/03/24 最終更新日: 2021/03/24
文書種別
制限事項
詳細
V13.2.3以降では、条件付き書式の設定範囲が1000行以下の場合は、次のようなコードで条件付き書式の設定範囲を変更できません。
◆サンプルコード
----------------------------------------------------
var sheet = spread.getActiveSheet();
var cf = sheet.conditionalFormats.getRules();
cf && cf.forEach(function (cfs) {
cfs.ranges().forEach(function (range) {
console.log("rowCount = " + range.rowCount);
range.rowCount = 1008;
});
});
----------------------------------------------------
◆サンプルコード
----------------------------------------------------
var sheet = spread.getActiveSheet();
var cf = sheet.conditionalFormats.getRules();
cf && cf.forEach(function (cfs) {
cfs.ranges().forEach(function (range) {
console.log("rowCount = " + range.rowCount);
range.rowCount = 1008;
});
});
----------------------------------------------------
回避方法
条件付き書式の設定範囲が1000行以下の場合は、次のようなコードで設定範囲を変更できます。
◆サンプルコード
----------------------------------------------------
var count = sheet.conditionalFormats.count() - 1;
for (var i=count; i>-1; i--){
var cf = sheet.conditionalFormats.getRule(i);
sheet.conditionalFormats.removeRule(cf);
cf.ranges().forEach(function (range) {
range.rowCount = 2000;
});
sheet.conditionalFormats.addRule(cf);
}
----------------------------------------------------
◆サンプルコード
----------------------------------------------------
var count = sheet.conditionalFormats.count() - 1;
for (var i=count; i>-1; i--){
var cf = sheet.conditionalFormats.getRule(i);
sheet.conditionalFormats.removeRule(cf);
cf.ranges().forEach(function (range) {
range.rowCount = 2000;
});
sheet.conditionalFormats.addRule(cf);
}
----------------------------------------------------
旧文書番号
86518