Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read in data to a combobox

Status
Not open for further replies.

daseffects

Technical User
Aug 21, 2003
38
GB
I have a series of comboboxes on a form which I want to preselect or preload with data form the spreadsheet when the form is activated.

I've tried code in different variations to the below w/ no luck.

UserForm1.ComboBox3.text = Range("eventsdatabase!E2").Value

D
 
Don't know about Excel for sure, but everywhere else, there is a method within the combo box like this:

ComboBox3.Add("String")

So what you'd have to do is loop through your range and add each one manually.

Ben

"If thine enemy offend thee, give his child a drum." - Anonymous
 
The combobox is already populated with a string. I just need the ability to preselect one or write in a value.

D
 
Oh, to *select* the item...

Check out the ListIndex Property of the combo box. I think it may be what you need.

Ben

"If thine enemy offend thee, give his child a drum." - Anonymous
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top