| 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.| Name | Value | Description |
|---|---|---|
| CFTP_LAST7DAYS | 0 | a date in the last seven days |
| CFTP_LASTMONTH | 1 | a date occuring in the last calendar month |
| CFTP_LASTWEEK | 2 | a date occuring last week |
| CFTP_NEXTMONTH | 3 | a date occuring in the next calendar month |
| CFTP_NEXTWEEK | 4 | a date occuring next week |
| CFTP_THISMONTH | 5 | a date occuring in this calendar month |
| CFTP_THISWEEK | 6 | a date occuring this week |
| CFTP_TODAY | 7 | today's date |
| CFTP_TOMORROW | 8 | tomorrow's date |
| CFTP_YESTERDAY | 9 | yesterday's date |
See also
- XL.ConditionalFormating.Add2ColorScaleRule
- XL.ConditionalFormating.Add3ColorScaleRule
- XL.ConditionalFormating.AddAboveAverageRule
- XL.ConditionalFormating.AddOpNumRule
- XL.ConditionalFormating.AddOpStrRule
- XL.ConditionalFormating.AddTopRule
- XL.LoadBook
Created 30th March 2024, last changed 31st March 2024
XL.ConditionalFormating.AddRule - XL.ConditionalFormating.AddTopRule