Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"ComboBox1.ListIndex = 0" Doesn't seem to always work.
Hi,
I have "ComboBox1" on a UserForm. In the Sub Form Initialize procedure, I have "ComboBox1.ListIndex = 0" hoping to set the ComboBox to Index 0 every time the Form is loaded. The problem is that maybe 50% of the time it loads up with the last selection instead. Am I doing something wrong? Thank you for your help! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
"ComboBox1.ListIndex = 0" Doesn't seem to always work.
If you are hiding your UserForm instead of unloading it, then the initialize
event won't fire when you show it again and your ComboBox will show the last selected value. Since you didn't post all of your code, I can't tell you much more. "JudgeMental" wrote: Hi, I have "ComboBox1" on a UserForm. In the Sub Form Initialize procedure, I have "ComboBox1.ListIndex = 0" hoping to set the ComboBox to Index 0 every time the Form is loaded. The problem is that maybe 50% of the time it loads up with the last selection instead. Am I doing something wrong? Thank you for your help! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
"ComboBox1.ListIndex = 0" Doesn't seem to always work.
If indeed the form was hidden, you could put the code into UserForm_Activate
to reset it when it is redisplayed. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "JLGWhiz" wrote in message ... If you are hiding your UserForm instead of unloading it, then the initialize event won't fire when you show it again and your ComboBox will show the last selected value. Since you didn't post all of your code, I can't tell you much more. "JudgeMental" wrote: Hi, I have "ComboBox1" on a UserForm. In the Sub Form Initialize procedure, I have "ComboBox1.ListIndex = 0" hoping to set the ComboBox to Index 0 every time the Form is loaded. The problem is that maybe 50% of the time it loads up with the last selection instead. Am I doing something wrong? Thank you for your help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running | Excel Programming | |||
pictures to work with "data" "sort" option | Excel Discussion (Misc queries) | |||
Why doesn't "Workbook.Range("myrange").value" work? | Excel Programming |