Defining My Own Event


Posted by George Clements on July 13, 2001 1:14 AM

Does anybody know how to define your own event statements. I want to have an event called 'OnScreenUpdate'.

Everytime the screenupdating is set to true the event fires and runs my code.

I have looked at 'Event Statement' in the help but this is very confusing.

Thanks in advance

George

Posted by Del on July 13, 2001 4:35 AM

Hello George,

Unfortunately you can't write your own events, you can only write code that executes in response to one of the built in Excel events firing.

Regards,
Del.



Posted by Joe Was on July 13, 2001 5:35 AM

Use IF Statements or other tests

You can simulate an Event with code; You can test for a value change in a range or a format change, ect. You can then set a variable called "OnScreenUpdate" and then test that variable for "True" or "False" or "0" or "1." If you put the test in a "Sheet-Tab View code" level macro and Set the variable there you can use it to activate a module level macro. It will not be a true "Excel Event" but it will act like one.

On this BB I saw a timer which acted like this, it ran a time function from the Sheet-Tab View code level and then at the programed times ran a module level macro. JSW