[フレーム]
 []
 
MESCIUS Logo MESCIUS Logo
Document Solutions for Excel, .NET Edition Logo
DEMOS DOCS API PRICING
FREE TRIAL
(Showing Draft Content)

Date Occurring Rule

The date occurring rule in conditional formatting feature compares the values entered in date format in the cells or a range of cells. This rule can be added using the DateOperator property of the IFormatCondition interface.

Refer to the following example code to add date occurring rule to a range of cells in a worksheet.

// Adding Date occuring rules
IFormatCondition condition = worksheet.Range["A1:A4"].FormatConditions.Add(FormatConditionType.TimePeriod) as IFormatCondition;
condition.DateOperator = TimePeriods.Yesterday;
condition.Interior.Color = Color.FromArgb(128, 0, 128);
DateTime now = DateTime.Today;
worksheet.Range["A1"].Value = now.AddDays(-2);
worksheet.Range["A2"].Value = now.AddDays(-1);
worksheet.Range["A3"].Value = now;
worksheet.Range["A4"].Value = now.AddDays(1);

AltStyle によって変換されたページ (->オリジナル) /