Removing All Items From A ComboBox? Removing All Items From A ComboBox? vba vba

Removing All Items From A ComboBox?


Psuedo code ahead (updated with actual code):

Do While ComboBox1.ListCount > 0    ComboBox1.RemoveItem (0)Loop

Basically, while you have items, remove the first item from the combobox. Once all the items have been removed (count = 0), your box is blank.

Method 2: Even better

ComboBox1.Clear


You need to remove each one individually unfortunately:

       For i = 1 To ListBox1.ListCount           'Remove an item from the ListBox using ListBox1.RemoveItem        Next i

Update - I don't know why my answer did not include the full solution:

For i = ListBox1.ListCount - 1 to 0 Step - 1         ListBox1.RemoveItem i Next i 


The simplest way:

Combobox1.RowSource = ""  'Clear the listCombobox1.Clear           'Clear the selected text