Class ConditionalFormatRuleBuilder

KoşulluBiçimlendirmeKuralOluşturucu

Koşullu biçimlendirme kuralları için oluşturucu.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a number between 1 and 10.
const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenNumberBetween(1, 10)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Yöntemler

YöntemDönüş türüKısa açıklama
build()ConditionalFormatRuleOluşturucuya uygulanan ayarlardan koşullu biçim kuralı oluşturur.
copy()ConditionalFormatRuleBuilderBu kuralın ayarlarını içeren bir kural oluşturucu hazır ayarı döndürür.
getBooleanCondition()BooleanConditionBu kural, boole koşulu ölçütleri kullanıyorsa kuralın BooleanCondition bilgilerini alır.
getGradientCondition()GradientConditionBu kural, gradyan koşulu ölçütlerini kullanıyorsa kuralın GradientCondition bilgilerini alır.
getRanges()Range[]Bu koşullu biçimlendirme kuralının uygulandığı aralıkları alır.
setBackground(color)ConditionalFormatRuleBuilderKoşullu biçim kuralının biçimi için arka plan rengini ayarlar.
setBackgroundObject(color)ConditionalFormatRuleBuilderKoşullu biçim kuralının biçimi için arka plan rengini ayarlar.
setBold(bold)ConditionalFormatRuleBuilderKoşullu biçimlendirme kuralının biçimi için metin kalınlaştırmayı ayarlar.
setFontColor(color)ConditionalFormatRuleBuilderKoşullu biçim kuralının biçimi için yazı tipi rengini ayarlar.
setFontColorObject(color)ConditionalFormatRuleBuilderKoşullu biçim kuralının biçimi için yazı tipi rengini ayarlar.
setGradientMaxpoint(color)ConditionalFormatRuleBuilderKoşullu biçimlendirme kuralının gradyan maksimum nokta değerini temizler ve bunun yerine kuralın aralıklarındaki maksimum değeri kullanır.
setGradientMaxpointObject(color)ConditionalFormatRuleBuilderKoşullu biçimlendirme kuralının gradyan maksimum nokta değerini temizler ve bunun yerine kuralın aralıklarındaki maksimum değeri kullanır.
setGradientMaxpointObjectWithValue(color, type, value)ConditionalFormatRuleBuilderKoşullu biçim kuralının gradyan maksimum nokta alanlarını ayarlar.
setGradientMaxpointWithValue(color, type, value)ConditionalFormatRuleBuilderKoşullu biçim kuralının gradyan maksimum nokta alanlarını ayarlar.
setGradientMidpointObjectWithValue(color, type, value)ConditionalFormatRuleBuilderKoşullu biçim kuralının gradyan orta nokta alanlarını ayarlar.
setGradientMidpointWithValue(color, type, value)ConditionalFormatRuleBuilderKoşullu biçim kuralının gradyan orta nokta alanlarını ayarlar.
setGradientMinpoint(color)ConditionalFormatRuleBuilderKoşullu biçim kuralının gradyan minimum nokta değerini temizler ve bunun yerine kuralın aralıklarındaki minimum değeri kullanır.
setGradientMinpointObject(color)ConditionalFormatRuleBuilderKoşullu biçim kuralının gradyan minimum nokta değerini temizler ve bunun yerine kuralın aralıklarındaki minimum değeri kullanır.
setGradientMinpointObjectWithValue(color, type, value)ConditionalFormatRuleBuilderKoşullu biçim kuralının gradyan minimum nokta alanlarını ayarlar.
setGradientMinpointWithValue(color, type, value)ConditionalFormatRuleBuilderKoşullu biçim kuralının gradyan minimum nokta alanlarını ayarlar.
setItalic(italic)ConditionalFormatRuleBuilderKoşullu biçim kuralının biçimi için metni italik yapar.
setRanges(ranges)ConditionalFormatRuleBuilderBu koşullu biçim kuralının uygulandığı bir veya daha fazla aralığı ayarlar.
setStrikethrough(strikethrough)ConditionalFormatRuleBuilderKoşullu biçimlendirme kuralının biçimi için metnin üzerini çizme özelliğini ayarlar.
setUnderline(underline)ConditionalFormatRuleBuilderKoşullu biçimlendirme kuralının biçimi için metin altı çizgisini ayarlar.
whenCellEmpty()ConditionalFormatRuleBuilderHücre boş olduğunda tetiklenecek koşullu biçim kuralını ayarlar.
whenCellNotEmpty()ConditionalFormatRuleBuilderKoşullu biçim kuralını, hücre boş olmadığında tetiklenecek şekilde ayarlar.
whenDateAfter(date)ConditionalFormatRuleBuilderKoşullu biçim kuralını, bir tarih belirli bir değerden sonra olduğunda tetiklenecek şekilde ayarlar.
whenDateAfter(date)ConditionalFormatRuleBuilderKoşullu biçim kuralını, bir tarih belirtilen göreli tarihten sonra olduğunda tetiklenecek şekilde ayarlar.
whenDateBefore(date)ConditionalFormatRuleBuilderKoşullu biçim kuralını, bir tarih belirtilen tarihten önce olduğunda tetiklenecek şekilde ayarlar.
whenDateBefore(date)ConditionalFormatRuleBuilderKoşullu biçim kuralını, bir tarih belirtilen göreli tarihten önce olduğunda tetiklenecek şekilde ayarlar.
whenDateEqualTo(date)ConditionalFormatRuleBuilderBir tarih, belirtilen tarihe eşit olduğunda tetiklenecek koşullu biçim kuralını ayarlar.
whenDateEqualTo(date)ConditionalFormatRuleBuilderBir tarih, belirtilen göreli tarihe eşit olduğunda tetiklenecek koşullu biçim kuralını ayarlar.
whenFormulaSatisfied(formula)ConditionalFormatRuleBuilderBelirtilen formül true olarak değerlendirildiğinde tetiklenecek koşullu biçim kuralını ayarlar.
whenNumberBetween(start, end)ConditionalFormatRuleBuilderKoşullu biçimlendirme kuralını, bir sayı iki belirtilen değer arasında olduğunda veya bu değerlerden biri olduğunda tetiklenecek şekilde ayarlar.
whenNumberEqualTo(number)ConditionalFormatRuleBuilderBir sayı, verilen değere eşit olduğunda tetiklenecek koşullu biçim kuralını ayarlar.
whenNumberGreaterThan(number)ConditionalFormatRuleBuilderBir sayı, verilen değerden büyük olduğunda tetiklenecek koşullu biçim kuralını ayarlar.
whenNumberGreaterThanOrEqualTo(number)ConditionalFormatRuleBuilderKoşullu biçimlendirme kuralını, bir sayı belirli bir değerden büyük veya bu değere eşit olduğunda tetiklenecek şekilde ayarlar.
whenNumberLessThan(number)ConditionalFormatRuleBuilderKoşullu biçim kuralını, verilen değerden küçük bir sayı olduğunda tetiklenecek şekilde ayarlar.
whenNumberLessThanOrEqualTo(number)ConditionalFormatRuleBuilderKoşullu biçim kuralını, verilen değerden küçük veya bu değere eşit bir sayı olduğunda tetiklenecek şekilde ayarlar.
whenNumberNotBetween(start, end)ConditionalFormatRuleBuilderBir sayı belirtilen iki değer arasında olmadığında ve bu değerlerden biri olmadığında tetiklenecek koşullu biçimlendirme kuralını ayarlar.
whenNumberNotEqualTo(number)ConditionalFormatRuleBuilderBir sayı, verilen değere eşit olmadığında tetiklenecek koşullu biçim kuralını ayarlar.
whenTextContains(text)ConditionalFormatRuleBuilderGirişin belirli bir değeri içermesi durumunda tetiklenecek koşullu biçim kuralını ayarlar.
whenTextDoesNotContain(text)ConditionalFormatRuleBuilderGiriş, belirtilen değeri içermediğinde tetiklenecek koşullu biçim kuralını ayarlar.
whenTextEndsWith(text)ConditionalFormatRuleBuilderGiriş, belirli bir değerle bittiğinde tetiklenecek koşullu biçim kuralını ayarlar.
whenTextEqualTo(text)ConditionalFormatRuleBuilderGiriş, belirli bir değere eşit olduğunda tetiklenecek koşullu biçim kuralını ayarlar.
whenTextStartsWith(text)ConditionalFormatRuleBuilderGiriş, belirli bir değerle başladığında tetiklenecek koşullu biçim kuralını ayarlar.
withCriteria(criteria, args)ConditionalFormatRuleBuilderKoşullu biçim kuralını, BooleanCriteria değerleri tarafından tanımlanan ölçütlere ayarlar. Bu değerler genellikle mevcut bir kuralın criteria ve arguments değerlerinden alınır.

Ayrıntılı belgeler

build()

Oluşturucuya uygulanan ayarlardan koşullu biçim kuralı oluşturur.

Return

ConditionalFormatRule: Koşullu biçim kuralının gösterimi.


copy()

Bu kuralın ayarlarını içeren bir kural oluşturucu hazır ayarı döndürür.

Return

ConditionalFormatRuleBuilder: Bu kuralın ayarlarına dayalı bir oluşturucu.


getBooleanCondition()

Bu kural, boole koşulu ölçütleri kullanıyorsa kuralın BooleanCondition bilgilerini alır. Aksi takdirde null değerini döndürür.

// Log the boolean criteria type of the first conditional format rules of a
// sheet.
const rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0];
const booleanCondition = rule.getBooleanCondition();
if (booleanCondition != null) {
  Logger.log(booleanCondition.getCriteriaType());
}

Return

BooleanCondition: Boole koşulu nesnesi veya kuralda Boole koşulu kullanılmıyorsa null.


getGradientCondition()

Bu kural, gradyan koşulu ölçütlerini kullanıyorsa kuralın GradientCondition bilgilerini alır. Aksi takdirde null değerini döndürür.

// Log the gradient minimum color of the first conditional format rule of a
// sheet.
const rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0];
const gradientCondition = rule.getGradientCondition();
if (gradientCondition != null) {
  // Assume the color has ColorType.RGB.
  Logger.log(gradientCondition.getMinColorObject().asRgbColor().asHexString());
}

Return

GradientCondition: Gradyan koşul nesnesi veya kuralda gradyan koşulu kullanılmıyorsa null.


getRanges()

Bu koşullu biçimlendirme kuralının uygulandığı aralıkları alır.

// Log each range of the first conditional format rule of a sheet.
const rule = SpreadsheetApp.getActiveSheet().getConditionalFormatRules()[0];
const ranges = rule.getRanges();
for (let i = 0; i < ranges.length; i++) {
  Logger.log(ranges[i].getA1Notation());
}

Return

Range[]: Bu koşullu biçim kuralının uygulandığı aralıklar.


setBackground(color)

Koşullu biçim kuralının biçimi için arka plan rengini ayarlar. null iletildiğinde kuraldan arka plan rengi biçimlendirme ayarı kaldırılır.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color to red if the cell has text equal to "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextEqualTo('hello')
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorStringİstenen renk veya null simgesiyle temizleyin.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setBackgroundObject(color)

Koşullu biçim kuralının biçimi için arka plan rengini ayarlar. null iletildiğinde kuraldan arka plan rengi biçimlendirme ayarı kaldırılır.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color to theme background color if the cell has text
// equal to "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const color = SpreadsheetApp.newColor()
                  .setThemeColor(SpreadsheetApp.ThemeColorType.BACKGROUND)
                  .build();
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextEqualTo('hello')
                 .setBackground(color)
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorColorİstenen renk nesnesi veya null simgesiyle temizleyin.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setBold(bold)

Koşullu biçimlendirme kuralının biçimi için metin kalınlaştırmayı ayarlar. bold true ise koşul karşılandığında kural metni kalınlaştırır. false ise koşul karşılandığında kural, mevcut kalınlaştırmaları kaldırır. null değerinin iletilmesi, kuraldaki kalın biçimlendirme ayarını kaldırır.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn their text bold if the cell has text equal to "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextEqualTo('hello')
                 .setBold(true)
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
boldBooleanBiçim koşulu karşılandığında metnin kalınlaştırılıp kalınlaştırılmayacağı; null bu ayarı kaldırır.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setFontColor(color)

Koşullu biçim kuralının biçimi için yazı tipi rengini ayarlar. null iletildiğinde kuraldan yazı tipi rengi biçim ayarı kaldırılır.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their font color to red if the cell has text equal to "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextEqualTo('hello')
                 .setFontColor('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorStringİstenen renk veya null simgesiyle temizleyin.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setFontColorObject(color)

Koşullu biçim kuralının biçimi için yazı tipi rengini ayarlar. null iletildiğinde kuraldan yazı tipi rengi biçim ayarı kaldırılır.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their font color to theme text color if the cell has text equal to
// "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const color = SpreadsheetApp.newColor()
                  .setThemeColor(SpreadsheetApp.ThemeColorType.TEXT)
                  .build();
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextEqualTo('hello')
                 .setFontColor(color)
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorColorİstenen renk nesnesi veya null simgesiyle temizleyin.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setGradientMaxpoint(color)

Koşullu biçimlendirme kuralının gradyan maksimum nokta değerini temizler ve bunun yerine kuralın aralıklarındaki maksimum değeri kullanır. Ayrıca, gradyanın maksimum nokta rengini giriş rengi olarak ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color somewhere between white and red, based on their
// values in comparison to the ranges minimum and maximum values.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .setGradientMaxpoint('#FF0000')
                 .setGradientMinpoint('#FFFFFF')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorStringAyarlanacak maksimum nokta rengi.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setGradientMaxpointObject(color)

Koşullu biçimlendirme kuralının gradyan maksimum nokta değerini temizler ve bunun yerine kuralın aralıklarındaki maksimum değeri kullanır. Ayrıca, gradyanın maksimum nokta rengini giriş rengi olarak ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color somewhere between theme text and background
// colors, based on their values in comparison to the ranges minimum and maximum
// values.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const textColor = SpreadsheetApp.newColor()
                      .setThemeColor(SpreadsheetApp.ThemeColorType.TEXT)
                      .build();
const backgroundColor =
    SpreadsheetApp.newColor()
        .setThemeColor(SpreadsheetApp.ThemeColorType.BACKGROUND)
        .build();
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .setGradientMaxpoint(textColor)
                 .setGradientMinpoint(backgroundColor)
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorColorAyarlanacak maksimum nokta rengi nesnesi.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setGradientMaxpointObjectWithValue(color, type, value)

Koşullu biçim kuralının gradyan maksimum nokta alanlarını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color somewhere from theme accent 1, accent 2 to accent
// 3 colors, based on their values in comparison to the values 0, 50, and 100.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const color1 = SpreadsheetApp.newColor()
                   .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT1)
                   .build();
const color2 = SpreadsheetApp.newColor()
                   .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT2)
                   .build();
const color3 = SpreadsheetApp.newColor()
                   .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT3)
                   .build();
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .setGradientMaxpointWithValue(
                     color1,
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '100',
                     )
                 .setGradientMidpointWithValue(
                     color2,
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '50',
                     )
                 .setGradientMinpointWithValue(
                     color3,
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '0',
                     )
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorColorAyarlanacak maksimum nokta rengi.
typeInterpolationTypeAyarlanacak maksimum nokta enterpolasyon türü.
valueStringAyarlanacak maksimum nokta değeri.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setGradientMaxpointWithValue(color, type, value)

Koşullu biçim kuralının gradyan maksimum nokta alanlarını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color somewhere from red green to blue, based on their
// values in comparison to the values 0, 50, and 100.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .setGradientMaxpointWithValue(
                     '#0000FF',
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '100',
                     )
                 .setGradientMidpointWithValue(
                     '#00FF00',
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '50',
                     )
                 .setGradientMinpointWithValue(
                     '#FF0000',
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '0',
                     )
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorStringAyarlanacak maksimum nokta rengi.
typeInterpolationTypeAyarlanacak maksimum nokta enterpolasyon türü.
valueStringAyarlanacak maksimum nokta değeri.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setGradientMidpointObjectWithValue(color, type, value)

Koşullu biçim kuralının gradyan orta nokta alanlarını ayarlar. Geçirilen enterpolasyon türü null ise tüm orta nokta alanlarını temizler.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color somewhere from theme accent 1 to accent 2 to
// accent 3 colors, based on their values in comparison to the values 0, 50, and
// 100.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const color1 = SpreadsheetApp.newColor()
                   .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT1)
                   .build();
const color2 = SpreadsheetApp.newColor()
                   .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT2)
                   .build();
const color3 = SpreadsheetApp.newColor()
                   .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT3)
                   .build();
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .setGradientMaxpointWithValue(
                     color1,
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '100',
                     )
                 .setGradientMidpointWithValue(
                     color2,
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '50',
                     )
                 .setGradientMinpointWithValue(
                     color3,
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '0',
                     )
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorColorAyarlanacak orta nokta rengi.
typeInterpolationTypeAyarlanacak orta nokta enterpolasyon türü veya temizlenecek null.
valueStringAyarlanacak orta nokta değeri.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setGradientMidpointWithValue(color, type, value)

Koşullu biçim kuralının gradyan orta nokta alanlarını ayarlar. Geçirilen enterpolasyon türü null ise tüm orta nokta alanlarını temizler.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color somewhere from red green to blue, based on their
// values in comparison to the values 0, 50, and 100.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .setGradientMaxpointWithValue(
                     '#0000FF',
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '100',
                     )
                 .setGradientMidpointWithValue(
                     '#00FF00',
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '50',
                     )
                 .setGradientMinpointWithValue(
                     '#FF0000',
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '0',
                     )
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorStringAyarlanacak orta nokta rengi.
typeInterpolationTypeAyarlanacak orta nokta enterpolasyon türü veya temizlenecek null.
valueStringAyarlanacak orta nokta değeri.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setGradientMinpoint(color)

Koşullu biçim kuralının gradyan minimum nokta değerini temizler ve bunun yerine kuralın aralıklarındaki minimum değeri kullanır. Ayrıca, gradyanın minimum nokta rengini giriş rengine ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color somewhere between white and red, based on their
// values in comparison to the ranges minimum and maximum values.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .setGradientMaxpoint('#FF0000')
                 .setGradientMinpoint('#FFFFFF')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorStringAyarlanacak minimum nokta rengi.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setGradientMinpointObject(color)

Koşullu biçim kuralının gradyan minimum nokta değerini temizler ve bunun yerine kuralın aralıklarındaki minimum değeri kullanır. Ayrıca, gradyanın minimum nokta rengini giriş rengine ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color somewhere between theme text and background
// colors, based on their values in comparison to the ranges minimum and maximum
// values.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const textColor = SpreadsheetApp.newColor()
                      .setThemeColor(SpreadsheetApp.ThemeColorType.TEXT)
                      .build();
const backgroundColor =
    SpreadsheetApp.newColor()
        .setThemeColor(SpreadsheetApp.ThemeColorType.BACKGROUND)
        .build();
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .setGradientMaxpoint(textColor)
                 .setGradientMinpoint(backgroundColor)
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorColorAyarlanacak minimum nokta rengi nesnesi.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setGradientMinpointObjectWithValue(color, type, value)

Koşullu biçim kuralının gradyan minimum nokta alanlarını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color somewhere from theme accent 1 to accent 2 to
// accent 3 colors, based on their values in comparison to the values 0, 50, and
// 100.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const color1 = SpreadsheetApp.newColor()
                   .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT1)
                   .build();
const color2 = SpreadsheetApp.newColor()
                   .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT2)
                   .build();
const color3 = SpreadsheetApp.newColor()
                   .setThemeColor(SpreadsheetApp.ThemeColorType.ACCENT3)
                   .build();
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .setGradientMaxpointWithValue(
                     color1,
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '100',
                     )
                 .setGradientMidpointWithValue(
                     color2,
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '50',
                     )
                 .setGradientMinpointWithValue(
                     color3,
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '0',
                     )
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorColorAyarlanacak minimum nokta rengi.
typeInterpolationTypeAyarlanacak minpoint enterpolasyon türü.
valueStringAyarlanacak minimum nokta değeri.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setGradientMinpointWithValue(color, type, value)

Koşullu biçim kuralının gradyan minimum nokta alanlarını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// set their background color somewhere from red to green to blue, based on
// their values in comparison to the values 0, 50, and 100.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .setGradientMaxpointWithValue(
                     '#0000FF',
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '100',
                     )
                 .setGradientMidpointWithValue(
                     '#00FF00',
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '50',
                     )
                 .setGradientMinpointWithValue(
                     '#FF0000',
                     SpreadsheetApp.InterpolationType.NUMBER,
                     '0',
                     )
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
colorStringAyarlanacak minimum nokta rengi.
typeInterpolationTypeAyarlanacak minpoint enterpolasyon türü.
valueStringAyarlanacak minimum nokta değeri.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setItalic(italic)

Koşullu biçim kuralının biçimi için metni italik yapar. italic, true ise koşul karşılandığında kural metni italik yapar. false ise koşul karşılandığında kural, mevcut italik biçimlendirmeyi kaldırır. null iletildiğinde kuraldaki italik biçim ayarı kaldırılır.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn their text italic if the cell has text equal to "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextEqualTo('hello')
                 .setItalic(true)
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
italicBooleanBiçim koşulu karşılandığında metnin italik yapılıp yapılmayacağı; null bu ayarı kaldırır.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setRanges(ranges)

Bu koşullu biçim kuralının uygulandığı bir veya daha fazla aralığı ayarlar. Bu işlem, mevcut aralıkları değiştirir. Boş bir dizi ayarlamak, mevcut aralıkları temizler. Bir kuralda en az bir aralık olmalıdır.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3
// and range D4:F6 to turn red if they contain a number between 1 and 10.
const sheet = SpreadsheetApp.getActiveSheet();
const rangeOne = sheet.getRange('A1:B3');
const rangeTwo = sheet.getRange('D4:F6');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenNumberBetween(1, 10)
                 .setBackground('#FF0000')
                 .setRanges([rangeOne, rangeTwo])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
rangesRange[]Bu koşullu biçim kuralının uygulandığı aralıklar.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setStrikethrough(strikethrough)

Koşullu biçimlendirme kuralının biçimi için metnin üzerini çizme özelliğini ayarlar. strikethrough true ise koşul karşılandığında kural metnin üzerini çizer. false ise koşul karşılandığında kural, mevcut üstü çizili biçimlendirmeyi kaldırır. null değerini iletmek, kuraldaki üstü çizili biçim ayarını kaldırır.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// strikethrough their text if the cell has text equal to "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextEqualTo('hello')
                 .setStrikethrough(true)
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
strikethroughBooleanBiçim koşulu karşılanırsa metnin üstünün çizilip çizilmeyeceği; null bu ayarı kaldırır.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


setUnderline(underline)

Koşullu biçimlendirme kuralının biçimi için metin altı çizgisini ayarlar. underline true ise koşul karşılandığında kural metnin altını çizer. false ise koşul karşılandığında kural mevcut alt çizgileri kaldırır. null değerini iletmek, kuraldan alt çizgi biçimlendirme ayarını kaldırır.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// underline their text if the cell has text equal to "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextEqualTo('hello')
                 .setUnderline(true)
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
underlineBooleanBiçim koşulu karşılandığında metnin altının çizilip çizilmeyeceği; null bu ayarı kaldırır.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenCellEmpty()

Hücre boş olduğunda tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they are empty.
const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenCellEmpty()
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenCellNotEmpty()

Koşullu biçim kuralını, hücre boş olmadığında tetiklenecek şekilde ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they are not empty.
const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenCellNotEmpty()
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenDateAfter(date)

Koşullu biçim kuralını, bir tarih belirli bir değerden sonra olduğunda tetiklenecek şekilde ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a date after 11/4/1993.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenDateAfter(new Date('11/4/1993'))
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
dateDateEn son tarih.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenDateAfter(date)

Koşullu biçim kuralını, bir tarih belirtilen göreli tarihten sonra olduğunda tetiklenecek şekilde ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a date after today.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenDateAfter(SpreadsheetApp.RelativeDate.TODAY)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
dateRelativeDateSeçilen tarih türüne göre en son tarih.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenDateBefore(date)

Koşullu biçim kuralını, bir tarih belirtilen tarihten önce olduğunda tetiklenecek şekilde ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a date before 11/4/1993.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenDateBefore(new Date('11/4/1993'))
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
dateDateKabul edilemeyecek en erken tarih.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenDateBefore(date)

Koşullu biçim kuralını, bir tarih belirtilen göreli tarihten önce olduğunda tetiklenecek şekilde ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a date before today.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenDateBefore(SpreadsheetApp.RelativeDate.TODAY)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
dateRelativeDateSeçilen tarih türüne göre en son tarih.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenDateEqualTo(date)

Bir tarih, belirtilen tarihe eşit olduğunda tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain the date 11/4/1993.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenDateEqualTo(new Date('11/4/1993'))
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
dateDateTek kabul edilebilir tarih.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenDateEqualTo(date)

Bir tarih, belirtilen göreli tarihe eşit olduğunda tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain todays date.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenDateEqualTo(SpreadsheetApp.RelativeDate.TODAY)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
dateRelativeDateSeçilen tarih türüne göre en son tarih.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenFormulaSatisfied(formula)

Belirtilen formül true olarak değerlendirildiğinde tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they satisfy the condition "=EQ(B4, C3)".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenFormulaSatisfied('=EQ(B4, C3)')
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
formulaStringGiriş geçerliyse true olarak değerlendirilen özel bir formül.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenNumberBetween(start, end)

Koşullu biçimlendirme kuralını, bir sayı iki belirtilen değer arasında olduğunda veya bu değerlerden biri olduğunda tetiklenecek şekilde ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a number between 1 and 10.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenNumberBetween(1, 10)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
startNumberKabul edilebilir en düşük değer.
endNumberKabul edilebilir en yüksek değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenNumberEqualTo(number)

Bir sayı, verilen değere eşit olduğunda tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain the number 10.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenNumberEqualTo(10)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
numberNumberKabul edilebilir tek değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenNumberGreaterThan(number)

Bir sayı, verilen değerden büyük olduğunda tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a number greater than 10.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenNumberGreaterThan(10)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
numberNumberKabul edilemeyen en yüksek değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenNumberGreaterThanOrEqualTo(number)

Koşullu biçimlendirme kuralını, bir sayı belirli bir değerden büyük veya bu değere eşit olduğunda tetiklenecek şekilde ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a number greater than or equal to 10.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenNumberGreaterThanOrEqualTo(10)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
numberNumberKabul edilebilir en düşük değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenNumberLessThan(number)

Koşullu biçim kuralını, verilen değerden küçük bir sayı olduğunda tetiklenecek şekilde ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a number less than 10.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenNumberLessThan(10)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
numberNumberKabul edilemeyecek en düşük değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenNumberLessThanOrEqualTo(number)

Koşullu biçim kuralını, verilen değerden küçük veya bu değere eşit bir sayı olduğunda tetiklenecek şekilde ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a number less than or equal to 10.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenNumberLessThanOrEqualTo(10)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
numberNumberKabul edilebilir en yüksek değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenNumberNotBetween(start, end)

Bir sayı belirtilen iki değer arasında olmadığında ve bu değerlerden biri olmadığında tetiklenecek koşullu biçimlendirme kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain a number not between 1 and 10.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenNumberNotBetween(1, 10)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
startNumberKabul edilemeyecek en düşük değer.
endNumberKabul edilemeyen en yüksek değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenNumberNotEqualTo(number)

Bir sayı, verilen değere eşit olmadığında tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they don't contain the number 10.

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenNumberNotEqualTo(10)
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
numberNumberTek kabul edilemez değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenTextContains(text)

Girişin belirli bir değeri içermesi durumunda tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they contain the text "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextContains('hello')
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
textStringGirişin içermesi gereken değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenTextDoesNotContain(text)

Giriş, belirtilen değeri içermediğinde tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they don't contain the text "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextDoesNotContain('hello')
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
textStringGirişin içermemesi gereken değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenTextEndsWith(text)

Giriş, belirli bir değerle bittiğinde tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they end with the text "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextEndsWith('hello')
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
textStringDizenin sonuyla karşılaştırılacak metin.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenTextEqualTo(text)

Giriş, belirli bir değere eşit olduğunda tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they have text equal to "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextEqualTo('hello')
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
textStringKabul edilebilir tek değer.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


whenTextStartsWith(text)

Giriş, belirli bir değerle başladığında tetiklenecek koşullu biçim kuralını ayarlar.

// Adds a conditional format rule to a sheet that causes cells in range A1:B3 to
// turn red if they start with the text "hello".

const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getRange('A1:B3');
const rule = SpreadsheetApp.newConditionalFormatRule()
                 .whenTextStartsWith('hello')
                 .setBackground('#FF0000')
                 .setRanges([range])
                 .build();
const rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
textStringDizenin başlangıcıyla karşılaştırılacak metin.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.


withCriteria(criteria, args)

Koşullu biçim kuralını, BooleanCriteria değerleri tarafından tanımlanan ölçütlere ayarlar. Bu değerler genellikle mevcut bir kuralın criteria ve arguments değerlerinden alınır.

// Adds a new conditional format rule that is a copy of the first active
// conditional format rule, except it instead sets its cells to have a black
// background color.

const sheet = SpreadsheetApp.getActiveSheet();
const rules = sheet.getConditionalFormatRules();
const booleanCondition = rules[0].getBooleanCondition();
if (booleanCondition != null) {
  const rule = SpreadsheetApp.newConditionalFormatRule()
                   .withCriteria(
                       booleanCondition.getCriteriaType(),
                       booleanCondition.getCriteriaValues(),
                       )
                   .setBackground('#000000')
                   .setRanges(rules[0].getRanges())
                   .build();
  rules.push(rule);
}
sheet.setConditionalFormatRules(rules);

Parametreler

AdTürAçıklama
criteriaBooleanCriteriaKoşullu biçim ölçütlerinin türü.
argsObject[]Ölçüt türüne uygun bir dizi bağımsız değişken. Bağımsız değişkenlerin sayısı ve türü, yukarıdaki ilgili when...() yöntemiyle eşleşir.

Return

ConditionalFormatRuleBuilder — Zincirleme için oluşturucu.