+ Reply to Thread
Results 1 to 4 of 4

Listbox item Highlighted but not Selected

  1. #1
    Registered User
    Join Date
    09-25-2008
    Location
    Winnetka, CA
    Posts
    83

    Listbox item Highlighted but not Selected

    I have a form with two single-select Listboxes. When the first one, lboCat, is clicked, it selects the first item in the other listbox by:

    Please Login or Register  to view this content.
    However, although the first item in the list is visibly selected, the lboSubCat.Value property is usually blank. (And no, there isn't any "" in the list).

    How can I return the actual value that's selected?

    Is there a better way to select the first item in the list? (The list of items changes depending on what's selected in lboCat.)

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Listbox item Highlighted but not Selected

    Try using the .Selected property to select a list item?

    http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

  3. #3
    Registered User
    Join Date
    09-25-2008
    Location
    Winnetka, CA
    Posts
    83

    Re: Listbox item Highlighted but not Selected

    Sorry, that doesn't seem to work.

    Here's an odder symptom: The text of the list comes from a cell on another worksheet, so I tried doing this:

    Please Login or Register  to view this content.
    But that doesn't work either.

  4. #4
    Registered User
    Join Date
    12-17-2015
    Location
    New York
    MS-Off Ver
    2010
    Posts
    1

    Re: Listbox item Highlighted but not Selected

    I know this is a late add on. But I had a similar issue. Where you used Listbox.Selected(X) = True to highlight the row but the Listbox.value was null or the original row that was previously selected.

    I resolved it by using:

    Listbox.Column(0, I)
    Where I is the index value

    To get the listbox value of the first column.


    Hope this helps.

    MM

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Listbox selected item not getting properly highlighted
    By KeithDyne in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-03-2021, 10:31 PM
  2. [SOLVED] Macro to run when item is selected from listbox
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-30-2014, 09:58 PM
  3. Listbox- 1st item is not getting highlighted
    By megha_gharote in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2013, 04:06 AM
  4. how do I return a HIGHLIGHTED (not selected) item from a ListBox?
    By michaeljoeyeager in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 08:27 AM
  5. Keep selected ListBox item highlighted when reopening userform
    By berlini in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-22-2011, 08:38 AM

Tags for this Thread

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1