I'm not sure what you are after.
Do you want to run some event code as part of a UDF (is findnum a UDF)?

Or do you want this UDF to modify some event code.