LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Evaluation of Conditional Formats

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formats, how to scroll and view all formats? Bill E Excel Worksheet Functions 0 May 12th 10 07:58 PM
Conditional Formats Carl New Users to Excel 2 May 19th 09 01:10 AM
Conditional Sum based on independent evaluation analysis headache Excel Worksheet Functions 1 August 2nd 08 02:23 AM
Conditional formats- paste special formats? jcarney Excel Discussion (Misc queries) 1 November 1st 07 06:37 PM
paste conditional formats as formats leo Excel Discussion (Misc queries) 2 July 5th 07 10:06 AM


All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"