ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combo problem again (https://www.excelbanter.com/excel-programming/327644-combo-problem-again.html)

filo666

Combo problem again
 
Hi, I want to put a combobox in one of my excels sheet, (a code combobox, not
a form combobox), inserting a subform and inside the subform the combobox is
easy, but I dont want to use subforms, so I Have the following code:

Private Sub CommandButton1_Click()
If ComboBox1.Visible = True Then
ComboBox1.Visible = False
Else
ComboBox1.Visible = True
asas
End If

End Sub

Private Sub asas()
ComboBox1.AddItem "Mesones", 1
ComboBox1.AddItem "Fray Servando", 2
ComboBox1.AddItem "Empresa", 3
ComboBox1.AddItem "Israel", 4
ComboBox1.AddItem "Consumo Interno", 5
ComboBox1.AddItem "Otros", 6
ComboBox1.DropDownLines = 3
ComboBox1.DropDownWidth = 75
ComboBox1.ListIndex = 0

End Sub

Could someone tell me how to do what I want to do???
PD. I also checked with private sub combobox1_initialize() giving me bad
results.
Thanks.

PD2. This question had already been responsed but since I bought 1 month ago
my VB for dummies book, I need a "for dummies" response
could you please help¡¡¡¡¡¡¡¡

Tom Ogilvy

Combo problem again
 
What is a subform?

There is no initialize event for a combobox.

Could someone tell me how to do what I want to do???


I don't know what you want to do, so I don't know what your question is.

--
Regards,
Tom Ogilvy




"filo666" wrote in message
...
Hi, I want to put a combobox in one of my excels sheet, (a code combobox,

not
a form combobox), inserting a subform and inside the subform the combobox

is
easy, but I don't want to use subforms, so I Have the following code:

Private Sub CommandButton1_Click()
If ComboBox1.Visible = True Then
ComboBox1.Visible = False
Else
ComboBox1.Visible = True
asas
End If

End Sub

Private Sub asas()
ComboBox1.AddItem "Mesones", 1
ComboBox1.AddItem "Fray Servando", 2
ComboBox1.AddItem "Empresa", 3
ComboBox1.AddItem "Israel", 4
ComboBox1.AddItem "Consumo Interno", 5
ComboBox1.AddItem "Otros", 6
ComboBox1.DropDownLines = 3
ComboBox1.DropDownWidth = 75
ComboBox1.ListIndex = 0

End Sub

Could someone tell me how to do what I want to do???
PD. I also checked with private sub combobox1_initialize() giving me bad
results.
Thanks.

PD2. This question had already been responsed but since I bought 1 month

ago
my VB for dummies book, I need a "for dummies" response
could you please help¡¡¡¡¡¡¡¡





All times are GMT +1. The time now is 08:53 PM.

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