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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top