Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In trying to solve a problem with a user form, I began to suspect that
multiple subs were being triggered as soon as I showed the form. I put a MsgBox into each sub in the code section of my userform, except for Userform_Initialize. The form has two multicolumn list boxes, two combo boxes, and three command buttons. Both listboxes and one combobox have change event subs. When I initially call up this userform (from a button in a Worksheet) the message box in the combobox change event sub appears once, the message box in one listbox appears twice, and the other appears three times! Is this normal behavior? Could this be why my listbox selection values are being cleared unexpectedly? I would really appreciate any help on this matter. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try using the click event rather than the change event.
-- Regards, Tom Ogilvy "zipdog" wrote in message oups.com... In trying to solve a problem with a user form, I began to suspect that multiple subs were being triggered as soon as I showed the form. I put a MsgBox into each sub in the code section of my userform, except for Userform_Initialize. The form has two multicolumn list boxes, two combo boxes, and three command buttons. Both listboxes and one combobox have change event subs. When I initially call up this userform (from a button in a Worksheet) the message box in the combobox change event sub appears once, the message box in one listbox appears twice, and the other appears three times! Is this normal behavior? Could this be why my listbox selection values are being cleared unexpectedly? I would really appreciate any help on this matter. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks very much for responding. I have actually used both click and
change. Same effect. I have overcome the initial problem using an event suppression solution from Dick Kusleika. Thanks, Dick! I also changed the first procedure from initialize to activate, though I am unclear what the difference is. It still seems weird to me that change and especially click events fire during Initialization. Even though I am please that I got my program to work, I would still love to understand what's going on with initialize, activate, and how they affect the values in listbox controls. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It depends on what you are doing in the Initialize and Activate events.
Using a boolean public variable is useful in many cases (but not all) to block events from running. -- Regards, Tom Ogilvy "zipdog" wrote in message ups.com... Thanks very much for responding. I have actually used both click and change. Same effect. I have overcome the initial problem using an event suppression solution from Dick Kusleika. Thanks, Dick! I also changed the first procedure from initialize to activate, though I am unclear what the difference is. It still seems weird to me that change and especially click events fire during Initialization. Even though I am please that I got my program to work, I would still love to understand what's going on with initialize, activate, and how they affect the values in listbox controls. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA macro runs fine, but freezes if I try to do ANYTHING else whileit runs | Setting up and Configuration of Excel | |||
ImageList must be initialized | Excel Programming | |||
Keping a UserForm open as VBA runs | Excel Programming | |||
Excel: VBA userform is shown but not loaded/initialized even though it was first unloaded? | Excel Programming | |||
listbox value not initialized | Excel Programming |