Thread: Combox In Form
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Combox In Form

The first is because you are adding all the items in the Change event, you
should load the combobox in some other event, such as Userform_Activate. You
can also use the Clear method to clear it out.

On the second, if you have a cell linked to the Combobox you just get the
index number. You will have to dump the value within the code.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Arunpd" wrote in message
...
Hi,

I have a combo box in an Excel Form and have the following values added to
it( code below).I have two issues over here.

a.When i select a value say "wife" from the combo box all the values get
repeated in the combo box .
b.Add when the value is selected the value written to the cell is a
"Number"
and not the value.

Private Sub ComboBox1_Change()
ComboBox1.AddItem "Father"
ComboBox1.AddItem "Mother"
ComboBox1.AddItem "Son"
ComboBox1.AddItem "Daughter"
ComboBox1.AddItem "Husband"
ComboBox1.AddItem "Wife"
'Set combo box to first entry
'ComboBox1.ListIndex = 0
End Sub

Pls help me out.

Regards
Arun