Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Before I explain the situation the question is
"What causes a conditional format to be evaluated?" A few threads down from here I answered a question about having a conditional format based on the absence (or presence) of a comment in the cell. I realized shortly after posting my initial response that it would not work. (Adding a column populated with a UDF that returned true or false based on a cell having a comment.) The UDF would not calculate because the addition of a comment would not initiate a calculation to update the UDF (even with application.volatile added). I didn't think it would work but I added the UDF directly to the conditional format and I will be darned... but it actually works (much to my surprise). The addition of a comment causes the formula in the conditional format to be evaluated. Here is the code... Public Function HasComment(ByVal Cell As Range) As Boolean If Cell.Comment Is Nothing Then HasComment = False Else HasComment = True End If End Function In Cell A1 add to the conditional format the formula =HasComment(A1) Now if you add or remove a comment the formatting changes. No events fire (selection change, calculate, change). So out of pure curiosity why does this work? What is causing the formula in the conditional format to be re-evaluated? -- Jim Thomlinson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Formats, how to scroll and view all formats? | Excel Worksheet Functions | |||
Conditional Formats | New Users to Excel | |||
Conditional Sum based on independent evaluation | Excel Worksheet Functions | |||
Conditional formats- paste special formats? | Excel Discussion (Misc queries) | |||
paste conditional formats as formats | Excel Discussion (Misc queries) |