Listbox Excel VBA – Form Control

Listbox Excel VBA

1. Clear Listbox  selected item in case of single selection

MyListBox.ListIndex =-1

2. Clear Listbox selected item(s) in case of multiple selection. You can avoid writing a loop to set the selected property of each item to False. Using following code, you can can do this in 3 straight steps.

ListBoxList.MultiSelect = fmMultiSelectSingle
ListBoxList.ListIndex = -1
ListBoxList.MultiSelect = fmMultiSelectExtended

Comments are closed.