Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 3 of 3

Thread: Deselect ListBox Item in Code

  1. #1
    Join Date
    18th July 2006
    Posts
    67

    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:

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

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    24th January 2003
    Location
    Australia
    Posts
    31,709

    Re: Listbox Deselect using VBA

    See Multi Select ListBox

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

  3. #3
    Join Date
    18th July 2006
    Posts
    67

    Re: Deselect ListBox Item in Code

    Perfect!!!

    Thank you

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. De-Select ListBox Item
    By The Dutchman in forum EXCEL HELP
    Replies: 3
    Last Post: June 19th, 2008, 04:24
  2. Deselect Selected Items In MultiSelect ListBox
    By abbyyjai in forum EXCEL HELP
    Replies: 2
    Last Post: January 22nd, 2008, 16:12
  3. Deselect ListView Item
    By asadose in forum EXCEL HELP
    Replies: 7
    Last Post: July 29th, 2007, 09:04
  4. Remove Listbox Item
    By Stingray in forum EXCEL HELP
    Replies: 3
    Last Post: July 20th, 2007, 06:24
  5. selecting item in listbox...
    By mjschukas in forum EXCEL HELP
    Replies: 2
    Last Post: October 11th, 2004, 00:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
porno