I need to conditional format 24 text boxes with 2 rules each. Each rule is slightly different, based on the month. Is there some way I can type my conditional format rules all in one screen so I don’t have to click so many buttons? Plus, this would save considerable time if I even needed to edit the rules. Psuedocode:
Style1 = FontFill.Red
Style2 = FontFill.Yellow
txtField1.ConditionalFormatting.Add("<rule text>", Style1)
txtField1.ConditionalFormatting.Add("<rule text>", Style2)
txtField2.ConditionalFormatting.Add("<rule text>", Style1)
txtField2.ConditionalFormatting.Add("<rule text>", Style2)
You can use the FormatConditions.Add Method in place of your pseudo code. With “Form3” open in Design View, I did the following in the Immediate window:
Then inspecting the format condition from the form property gave me this …
For 24 controls, you could create a procedure to apply the conditional formats. Modify the procedure when the rules change. Or store the rules in a table and have the procedure read the rules from the table.