Very simple code piece. Felt like I should contribute something, however minimal. This will clear a multiselect listbox. I use these a lot as I have a few "power search" forms to run complex reports on the fly, and I use a lot of multiselect list boxes to allow the user a lot of flexibility with their search. So I also need to clear these with my clear all button if they want to start over.
Code:
'*************************************************
'** CLEAR LIST BOX **
'** This function takes one argument as a **
'** list box. The function traverses all of **
'** the selected items in the listbox and **
'** deselects them. **
'*************************************************
Public Sub subClearListBox(ByVal lstMyListBox As ListBox)
Dim varItem As Variant
With lstMyListBox
For Each varItem In .ItemsSelected
.Selected(varItem) = False
Next varItem
End With
End Sub