Solved

VBA ComboBox default value?

Posted on 2010-11-20
7
1,220 Views
Last Modified: 2012-08-14
I have a ComboBox3 on userform1, that I would like to default to "Select from List" when the userform is shown.  I have other comboboxes that I would like shown blank.  Currently they are all blank and I am not sure how I did that.

How do I show the "Select from List" default value, and not have it as part of the list to select from.

Please advise and thanks. -R-
0
Comment
Question by:RWayneH
  • 3
  • 2
  • 2
7 Comments
 
LVL 19

Expert Comment

by:Montoya
ID: 34180431
The text property in the Combobox would give you what you want. You can do it programatically, or you can just change the Text Property by clicking on your combobox and then going to Properties section and look for Text.
0
 

Author Comment

by:RWayneH
ID: 34180546
What is the programatic code version of this command so I can reset it to blank and reset focus to the combobox?  -R-
0
 
LVL 19

Expert Comment

by:Montoya
ID: 34180572
Combo1.Text="Select from List"
Combo1.SetFocus

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 45

Accepted Solution

by:
patrickab earned 500 total points
ID: 34180588
For a blank:

Combo1.Text=""
Combo1.SetFocus
0
 

Author Comment

by:RWayneH
ID: 34181011
Thanks this is it and I got it to work.  -R-
0
 

Author Closing Comment

by:RWayneH
ID: 34181013
Thanks for the help!  EXCELent!
0
 
LVL 45

Expert Comment

by:patrickab
ID: 34181019
RWayne - Thanks for the grade - Patrick
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

29 Experts available now in Live!

Get 1:1 Help Now