ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combo Box Wont Show Values (https://www.excelbanter.com/excel-programming/405876-combo-box-wont-show-values.html)

phil

Combo Box Wont Show Values
 
Hi,

I have put a simple combobox in to my form and have coded the values for the
drop down in the VBA, looking like this

Private Sub cboRegion_Change()

End Sub
Private Sub UserForm1_Initialize()
With cboRegion
.AddItem "NW"
.AddItem "SW"
.AddItem "SE"
.AddItem "NE"
End With
cboRegion.Value = ""
End Sub

I have checked that the combobox name is the same but every time I run it, I
get none of the above values, am I doing something really silly.

Thanks

Rick Rothstein \(MVP - VB\)[_1265_]

Combo Box Wont Show Values
 
Remove the "1" from your "UserForm1_Initialize" declaration... You should
really just select the event procedures from the drop down list provided
rather than type them in manually.

Rick



"Phil" wrote in message
...
Hi,

I have put a simple combobox in to my form and have coded the values for
the
drop down in the VBA, looking like this

Private Sub cboRegion_Change()

End Sub
Private Sub UserForm1_Initialize()
With cboRegion
.AddItem "NW"
.AddItem "SW"
.AddItem "SE"
.AddItem "NE"
End With
cboRegion.Value = ""
End Sub

I have checked that the combobox name is the same but every time I run it,
I
get none of the above values, am I doing something really silly.

Thanks



phil

Combo Box Wont Show Values
 
Hi Rick

Thanks for that, thought it would be something stupid like that, teach me to
do these types of things so late at night.

Thanks Again, Phil

"Rick Rothstein (MVP - VB)" wrote:

Remove the "1" from your "UserForm1_Initialize" declaration... You should
really just select the event procedures from the drop down list provided
rather than type them in manually.

Rick



"Phil" wrote in message
...
Hi,

I have put a simple combobox in to my form and have coded the values for
the
drop down in the VBA, looking like this

Private Sub cboRegion_Change()

End Sub
Private Sub UserForm1_Initialize()
With cboRegion
.AddItem "NW"
.AddItem "SW"
.AddItem "SE"
.AddItem "NE"
End With
cboRegion.Value = ""
End Sub

I have checked that the combobox name is the same but every time I run it,
I
get none of the above values, am I doing something really silly.

Thanks





All times are GMT +1. The time now is 02:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com