Vba excel - Combo box question - erasing value

  • Thread starter Thread starter ajliaks
  • Start date Start date
A

ajliaks

Hi all,

I have a combo box full of data. One of the data is "<New Item>".
want to locate, and erase that value from the list.
I am trying the code below, but getting sintax error.
Can anybody help? Thanks in advance, Aldo.

For c1 = 0 To ComboBox.ListCount
If ComboBox.Value(c1) = "<New Item>" Then
ComboBox(c1).clear
exit for
End If
Next c
 
For c1 = 0 To ComboBox.ListCount - 1
If Instr(1,ComboBox.List(c1) ,"<New Item>",vbTextcompare) Then
ComboBox.RemoveItem c1
exit for
End If
Next c1
 

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

Back
Top