View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
John Coleman John Coleman is offline
external usenet poster
 
Posts: 274
Default event triggered by cell format change?


Stefi wrote:
Hi All,

I'd like to run a macro (similarly to a Change event) when the cell format
(e.g. font color) of a cell changes.
How can I do that?

Thanks,
Stefi


There is no direct way to do so. But - to change the format of a cell
you presumably must first select it. You could try the following
strategy - in the SelectionChange event record the target in a public
range variable, as well as the format information you want to monitor,
Presumably the user will then do something else - change a value or
change the selection. In event handlers for those you could first check
the format information of the range object stored in the public range
variable and see if it has been changed. It might be hard to make this
robust (I used the word "presumably" twice in the above - a sure sign
of potential bugs), but I think it could work. The main problem would
be the lag between when the format changes and when the "event" fires.

Just an idea

-John Coleman