Unselect data in a Listbox

  • Thread starter Thread starter Chris Gorham
  • Start date Start date
C

Chris Gorham

Hi,

once a user has selected a row of data contained in a
listbox, how do I unselect and clear the highlight without
reloading the data into the listbox...??

Thks....Chris
 
I put two listboxes on a userform. Listbox1 was set for multiselect and
listbox2 could only have one selection:

Option Explicit
Private Sub CommandButton1_Click()
Dim iCtr As Long

For iCtr = 0 To Me.ListBox1.ListCount - 1
Me.ListBox1.Selected(iCtr) = False
Next iCtr

End Sub
Private Sub CommandButton2_Click()
Me.ListBox2.ListIndex = -1
End Sub
 
Back
Top