ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unselect data in a Listbox (https://www.excelbanter.com/excel-programming/286599-unselect-data-listbox.html)

Chris Gorham[_3_]

Unselect data in a Listbox
 
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

Dave Peterson[_3_]

Unselect data in a Listbox
 
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



Chris Gorham wrote:

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


--

Dave Peterson



All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com