Evaluation of Conditional Formats
Maybe if I am good in my next life I will be able to come back as an Excel
Developer. I always wanted to be really smart... :-)
--
HTH...
Jim Thomlinson
"Dave Peterson" wrote:
Of course not.
But it is redundant!
If you're an excel developer, then you have to be really smart <vvbg.
Jim Thomlinson wrote:
Really Smart Excel Developers? Is that an oxymoron... <vbg
--
HTH...
Jim Thomlinson
"Dave Peterson" wrote:
That's an excellent question.
I'm gonna take a post your question in a private discussion group--just so it's
not missed by the really smart excel developers (RSED's <vbg).
It's beyond me!
Jim Thomlinson wrote:
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
--
Dave Peterson
--
Dave Peterson
|