View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dirk[_2_] Dirk[_2_] is offline
external usenet poster
 
Posts: 8
Default Conditional formatting formula is evaluated repeatedly

Hello

I want to use a vba function in a formula for conditional formatting and
found that this formula is evaluated repeatedly under certain circumstances.
For a simple test I used

Function vbaFormat(ByRef rng as Range) as Boolean
vbaFormat = True
Debug.Print CStr(Now)
End Function

and as the format formula:
=NOT(vbaFormat(D16:D20)) ' make font color red

The cell where the format is applied is not part of the range that is passed
to vbaFormat.
When I select this cell and then do nothing the vbaFormat is called about 2
times per second. This also depends on the position of the mouse cursor. The
cell and the range for the function do not contain any data.
Does anyone know why this function is called repeatedly though there is no
user interaction and no macros are running in the background?
I use Excel 2003

Thanks