Create Combobox Visual Basic

G

Guest

Hi!

I have a problem with Comboboxes. I need to add combobox to some cells in
excel. And there would have to be some options to select. So to create a
combobox and add options I´m doing this.

Private Sub ComboBox1_Change()
ComboBox1.AddItem "A"
ComboBox1.AddItem "B"
ComboBox1.AddItem "C"
End Sub


The problem is that the options will be added each time I click om the
combomeny. So does any one know how to create a combobox and add a list of
options with Visual Basic code.
I also need to refer a cell to a combobox so it is just allowed to change
the option in that specifed cell and so the combo box should not move from
the cell if someone would try.

Thanx
 
B

Bob Phillips

You could just clear it each time, a bit simpler than building on the fly.

Combobocx1.Clear
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top