
When the worksheet function executes, it returns a #VALUE! error. For example, on a worksheet function that returns the interior color of a cell, you use a line similar to: Range(n). Note that the DisplayFormat property does not work in User Defined Functions (UDF). Set addedFormatCondition = (xlExpression, Formula1:="=true")Ī = XlRgbColor.rgbRedĪ = XlPattern.xlPatternCheckerĭebug.Print 'XlRgbColor.rgbWhiteĭebug.Print 'XlPattern.xlPatternNoneĭebug.Print 'Trueĭebug.Print 'XlRgbColor.rgbRedĭebug.Print 'XlPattern.xlPatternChecker Public Sub DemonstrateConditionalFormattingAffectsDisplayFormat()ĭim addedFormatCondition As FormatCondition This formatting bolds the cell, changes the interior color to red and adds a checker pattern. It adds conditional formatting to Cell A1 on the ActiveSheet. Return valueĭisplayFormat is affected by conditional formatting as shown in the code below.

SyntaxĮxpression A variable that represents a Range object. Returns a DisplayFormat object that represents the display settings for the specified range.
