Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default combo box problem

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default combo box problem

Why don't you just use Data Validation and set it to a list?

"filo666" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default combo box problem

See your post of 16th April

--

HTH

RP
(remove nothere from the email address if mailing direct)


"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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default combo box problem

Sorry, but I didn't understand preaty well what you want me to do, I bought a
VB for dummies book a month ago, so I need a dummies response, could you
pleade answer me as easy as posible???
TIA

"Bob Phillips" wrote:

See your post of 16th April

--

HTH

RP
(remove nothere from the email address if mailing direct)


"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.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default combo box problem

In the previous post, I asked a question as your example code confused me a
bit.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"filo666" wrote in message
...
Sorry, but I didn't understand preaty well what you want me to do, I

bought a
VB for dummies book a month ago, so I need a dummies response, could you
pleade answer me as easy as posible???
TIA

"Bob Phillips" wrote:

See your post of 16th April

--

HTH

RP
(remove nothere from the email address if mailing direct)


"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.






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
Combo box problem R Ormerod Excel Discussion (Misc queries) 1 August 14th 07 01:12 PM
Combo box problem R Ormerod Excel Discussion (Misc queries) 3 August 13th 07 09:52 AM
Simple combo box problem JonathanW Excel Discussion (Misc queries) 1 March 23rd 07 11:53 AM
Combo Box properties problem Simon205 Excel Worksheet Functions 2 May 23rd 06 10:13 AM
Combo Box problem tmjhiphopcom Excel Discussion (Misc queries) 2 November 6th 05 05:30 PM


All times are GMT +1. The time now is 06:48 AM.

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"