Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

XL.ConditionalFormating.AddTimePeriodRule

Adds a conditional formatting rule that highlights cells containing dates in the specified time period.

Component Version macOS Windows Linux Server iOS SDK
XL 14.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "XL.ConditionalFormating.AddTimePeriodRule"; bookRef; ConditionalFormattingRef; TimePeriod { ; StopIfTrue } )   More

Parameters

Parameter Description Example Flags
bookRef The reference to the workbook. Please use XL.LoadBook to load a file. $ref
ConditionalFormattingRef The reference number for the conditional formatting. $ConditionalFormatting
TimePeriod The applicable time period, see the list of values below. 1
StopIfTrue If true, no rules with lower priority may be applied over this rule, when this rule is true.
Default is false.
false Optional

Result

Returns OK or error.

Description

Adds a conditional formatting rule that highlights cells containing dates in the specified time period.

NameValueDescription
CFTP_LAST7DAYS0a date in the last seven days
CFTP_LASTMONTH1a date occuring in the last calendar month
CFTP_LASTWEEK2a date occuring last week
CFTP_NEXTMONTH3a date occuring in the next calendar month
CFTP_NEXTWEEK4a date occuring next week
CFTP_THISMONTH5a date occuring in this calendar month
CFTP_THISWEEK6a date occuring this week
CFTP_TODAY7today's date
CFTP_TOMORROW8tomorrow's date
CFTP_YESTERDAY9yesterday's date

See also

Created 30th March 2024, last changed 31st March 2024


XL.ConditionalFormating.AddRule - XL.ConditionalFormating.AddTopRule