How can I programmatically remove all items from a combobox in VBA?
A:
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
Tommy
2010-06-08 14:27:07
+1
A:
You need to remove each one individually unfortunately:
For i = 1 To ListBox1.ListCount
'Remove an item from the ListBox.
ListBox1.RemoveItem 0
Next i
David Relihan
2010-06-08 14:29:01
Worked like a charm, thanks!
Soo
2010-06-08 20:48:39