Excel Combo box help

  • Thread starter Thread starter maxmil
  • Start date Start date
M

maxmil

Hi everybody,

I have a simple question regarding how a combo box works in excel.
I open a combo box from the Forms toolbar.
Combo box means that I can either choose from the selection menu EITHER
WRITE my own text.
My problem is that I cannot write my own text choosing the combo from
the Forms tolbar, I can only select the cells from which populate the
menu.
How can I write my own text in the combo box?

Many thanks in advance for your help!

Regards
Max
 
Try a combobox from the Control Toolbox menu (View > Toolbars, selec
control toolbox). Enter the following code in the sheets module:

Private Sub ComboBox1_Change()
For Each ob In ComboBox1.List
If ComboBox1.Value = ob Then Exit Sub
Next
Set srng = Range("A1")
Cells(srng.End(xlDown).Row + 1, srng.Column) = ComboBox1.Value
End Sub

Private Sub Worksheet_Activate()
Set srng = Range("A1")
Set rng = Range(srng, srng.End(xlDown))
ComboBox1.Clear
For Each cl In rng
ComboBox1.AddItem cl.Value
Next
End Sub


Assumpotions, your range starts at A1, and when a user does not selec
a combo-box value, but adds a new one, it is stored at the end of th
list, and the user can select this later.


Manges
 
Back
Top