Hi,
Can you call subs on Workbook events and Worksheet events from a sub in a normal module?
Hi,
Can you call subs on Workbook events and Worksheet events from a sub in a normal module?
You can, but there shouldn't be any need. If you need to do that, you should put the code into a routine in a normal module and call it from both the event procedure and the other code.
Don
Please remember to mark your thread 'Solved' when appropriate.
Yes, you can.
IMHO best practice is to create a Sub with whatever functionality you need to call from multiple places. Then if you have an event handler, call that Sub. Then call the same Sub from other places if needed. I prefer not to call event handlers of any type, but that is my personal preference.Please Login or Register to view this content.
My preferred alternative:
Please Login or Register to view this content.
Jeff
| | |·| |·| |·| |·| | |:| | |·| |·|
Read the rules
Use code tags to [code]enclose your code![/code]
But you cannot call them from outside the current module they reside in
You can, either using Application.Run or by making the event routines Public rather than Private.
can you show me an example please?
for instance. Again though, this is not the best way to do it.Please Login or Register to view this content.
Ok, cool, now I understand.
Thank You xlnitwit
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks