Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default "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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default "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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default "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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string Raja Mahendiran S Excel Worksheet Functions 6 May 12th 10 09:10 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running [email protected] Excel Programming 5 May 16th 07 08:18 PM
pictures to work with "data" "sort" option arad Excel Discussion (Misc queries) 1 April 18th 06 09:15 PM
Why doesn't "Workbook.Range("myrange").value" work? Brad Patterson Excel Programming 0 July 9th 03 01:24 AM


All times are GMT +1. The time now is 11:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"