ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   event triggered by cell format change? (https://www.excelbanter.com/excel-programming/349982-event-triggered-cell-format-change.html)

Stefi

event triggered by cell format change?
 
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


Bob Phillips[_6_]

event triggered by cell format change?
 
Stefi,

There is no event to trap a format change.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Stefi" wrote in message
...
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




Stefi

event triggered by cell format change?
 
And can't I define one with Event Statement?

Stefi


€˛Bob Phillips€¯ ezt Ć*rta:

Stefi,

There is no event to trap a format change.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Stefi" wrote in message
...
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





John Coleman

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


Bob Phillips[_6_]

event triggered by cell format change?
 
I don't think so as that allows you to raise events in your code and trap
these. But the format change would be in Excel, not in your code.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Stefi" wrote in message
...
And can't I define one with Event Statement?

Stefi


"Bob Phillips" ezt ķrta:

Stefi,

There is no event to trap a format change.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Stefi" wrote in message
...
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








All times are GMT +1. The time now is 08:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com