#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ComboBox

Can anyone help - Im new to this stuff!

Im trying to add list entries to combo box. My form initializes - the combo
is there but there is nothing in the list. What am I doing wrong?


Private Sub UserFormSection1_Initialize()

ComboBoxWeather.AddItem "Poor" 'index 0
ComboBoxWeather.AddItem "Fair" ' index 1
ComboBoxWeather.AddItem "Good" ' index 2

ComboBoxWeather.Style = fmStyleDropDownCombo
ComboBoxWeather.ListIndex = 0

ComboBoxWeather.Enabled = True
ComboBox1.Left = 252
ComboBox1.Top = 6
ComboBox1.Width = 168
ComboBox1.Height = 18


End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default ComboBox

Michelle,

Is your user form actually called "UserFormSection1"?

I also notice that you refer to 2 different comboboxes: ComboBoxWeather
and ComboBox1.

Check the names of your form and comboboxes to make sure your code is
referring to actual objects.

The other thing to check is that you're not positioning your combobox
off your form -- that Left=252 is not off the form entirely.

--
Dianne

In ,
Michelle Bryant typed:

Private Sub UserFormSection1_Initialize()

ComboBoxWeather.AddItem "Poor" 'index 0
ComboBoxWeather.AddItem "Fair" ' index 1
ComboBoxWeather.AddItem "Good" ' index 2

ComboBoxWeather.Style = fmStyleDropDownCombo
ComboBoxWeather.ListIndex = 0

ComboBoxWeather.Enabled = True
ComboBox1.Left = 252
ComboBox1.Top = 6
ComboBox1.Width = 168
ComboBox1.Height = 18


End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default ComboBox

Michelle,

Your code worked well for me. (Once I changed Combobox1 to
ComboboxWeather). Are you sure you have named the combobox correctly? You
can check this in the properties window.

Chris

"Michelle Bryant" wrote in message
...
Can anyone help - Im new to this stuff!

Im trying to add list entries to combo box. My form initializes - the

combo
is there but there is nothing in the list. What am I doing wrong?


Private Sub UserFormSection1_Initialize()

ComboBoxWeather.AddItem "Poor" 'index 0
ComboBoxWeather.AddItem "Fair" ' index 1
ComboBoxWeather.AddItem "Good" ' index 2

ComboBoxWeather.Style = fmStyleDropDownCombo
ComboBoxWeather.ListIndex = 0

ComboBoxWeather.Enabled = True
ComboBox1.Left = 252
ComboBox1.Top = 6
ComboBox1.Width = 168
ComboBox1.Height = 18


End Sub




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
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
ComboBox value? dksaluki Excel Discussion (Misc queries) 1 February 28th 08 03:24 AM
Combobox nc Excel Discussion (Misc queries) 1 September 28th 05 02:11 PM
combobox Nicky* Excel Programming 3 July 28th 03 09:26 PM
Combobox Scott Excel Programming 2 July 23rd 03 02:49 PM


All times are GMT +1. The time now is 10:49 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"