Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Initialize
Can someone please explain "Initialize" in when working with Userforms in
Excel? How to implement in Userform? Thank you in advance for help on this. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Initialize
The initialize event occurs when you LOAD or SHOW a user form e.g.
Load UserForm1 UserForm1.Show You can put your own code into this event so that you can set up objects on the UserForm (control defaults etc), other conditions or run other sub routines that are required to run before the UserForm is loaded into memory and or show(n) to the user. Each UserForm has its own initialize event which is stored on the UserForm code sheet. e.g. Private Sub UserForm_Initialize() ' put code in here to run when the UserForm is load(ed) or show(n) End Sub Note that the UserForm reference above is always the same regardless on the actual UserForm name -- Regards, Nigel "TotallyConfused" wrote in message ... Can someone please explain "Initialize" in when working with Userforms in Excel? How to implement in Userform? Thank you in advance for help on this. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Initialize
This is not totally correct.
The Initialize event is triggered when the form is loaded, or if a control on a non-loaded form is referenced. The Activate is triggered when the form is shown. So, for a form that is loaded and shown and then hidden and re-shown a number of times, the Initialize event is fired once, the Activate is fired each time. For a form that is loaded then unloaded, the re-loaded, unloaded, etc., the Initialize event and the Activate is fired each time. Note that if you show a form that has not yet been loaded, it will automatically load and trigger the Initialize event as well. -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Nigel" wrote in message ... The initialize event occurs when you LOAD or SHOW a user form e.g. Load UserForm1 UserForm1.Show You can put your own code into this event so that you can set up objects on the UserForm (control defaults etc), other conditions or run other sub routines that are required to run before the UserForm is loaded into memory and or show(n) to the user. Each UserForm has its own initialize event which is stored on the UserForm code sheet. e.g. Private Sub UserForm_Initialize() ' put code in here to run when the UserForm is load(ed) or show(n) End Sub Note that the UserForm reference above is always the same regardless on the actual UserForm name -- Regards, Nigel "TotallyConfused" wrote in message ... Can someone please explain "Initialize" in when working with Userforms in Excel? How to implement in Userform? Thank you in advance for help on this. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform Initialize | Excel Programming | |||
UserForm initialize event run when UserForm is shown | Excel Programming | |||
UserForm initialize | Excel Programming | |||
userform initialize | Excel Programming | |||
initialize userform, using a sub | Excel Programming |