Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
For the sake of clarity, i want to write event procedures that refer to some components in a Userform, in a separate regular module. Is it possible to do so and how should i reference the UserForm in the regular module? For example, how should this code look in a regular module, while it comes from UserForm1? Sub Label30_Click() Test_GetAColor Label30.BackColor = UserColor End Sub Many thanks Avi |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can't put event procedures in a regular code module. Events can be used
only in an object module (the form's code module, a Sheet module, the ThisWorkbook module, or a class module). I don't see what advantage using separate class to handle event would bring, but you can certainly do it with a class. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "avi" wrote in message ups.com... Hello, For the sake of clarity, i want to write event procedures that refer to some components in a Userform, in a separate regular module. Is it possible to do so and how should i reference the UserForm in the regular module? For example, how should this code look in a regular module, while it comes from UserForm1? Sub Label30_Click() Test_GetAColor Label30.BackColor = UserColor End Sub Many thanks Avi |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your clarification.
My need comes from the fact that the Userform code becomes very long and difficult to manage, but it is not a critical issue Avi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
UserForm initialize event run when UserForm is shown | Excel Programming | |||
Help.. Add an event to a sheet module | Excel Programming | |||
Option Private Module not preventing cross project referencing | Excel Programming | |||
referencing at module level | Excel Programming | |||
Run module ON OPEN event?? | Excel Programming |