Announcement

Collapse
No announcement yet.

Deselect ListBox Item in Code

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deselect ListBox Item in Code



    I think this should be simple to answer. I have a userform that has multiple listboxes on it.

    When the user makes a selection in Listbox1 it highlights the item selected then when the user makes a selection in Listbox2 it highlights that next item and the selection in listbox1 remains highlighted.

    What I want is to deselect the selection in Listbox1 when Listbox2 is selected.

    I have tried things like below:

    Code:
    Sub Listbox2_Click ()
    
    Me.Listbox1.Deselect
    
    End Sub
    Can anyone help?
    Last edited by XLeary; August 18th, 2006, 16:46.

  • #2
    Re: Listbox Deselect using VBA

    See Multi Select ListBox

    Basically, it's like below
    Code:
     ListBox1.Selected(ListBox1.ListIndex) = False
    Last edited by Dave Hawley; August 18th, 2006, 16:52.

    Comment


    • #3


      Re: Deselect ListBox Item in Code

      Perfect!!!

      Thank you

      Comment

      Working...
      X