Name

commandbarcombobox.Clear( )

Synopsis

Removes all the items from the list. The following code removes the items added in the preceding AddDropDown procedure:

Sub RemoveAll( )
    Dim cbo As CommandBarComboBox, i As Integer
    ' Get the control
    Set cbo = CommandBars("Worksheet Menu Bar").FindControl _
      (msoControlDropdown, , "cboSelectText", , True)
    ' Remove the items.
    cbo.Clear
End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.