+ Reply to Thread
Results 1 to 5 of 5

Getting value of specific Listbox Item

  1. #1
    Registered User
    Join Date
    09-17-2009
    Location
    Galati, Romania
    MS-Off Ver
    Excel 2003
    Posts
    32

    Getting value of specific Listbox Item

    Hello,

    Let's say you create a listbox and populate it with values. Is there a way to get the value of a specific listbox item?
    So let's say i want to get the value of the item that is in the 3rd position in the listbox, can i do that?

    Thank you.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Getting value of specific Listbox Item

    What kind of list box, user form, ActiveX or Forms menu?

    For a list box from the forms menu, it would be
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Getting value of specific Listbox Item

    Normally you use the item that's been selected, but this will put the value of the third item (as long as there is one) from a list box called ListBox1 on an userform into a message box so you adapt it as you need:

    Please Login or Register  to view this content.
    Note the the number is actually one less than the required number as the first list box index number is zero.

    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  4. #4
    Registered User
    Join Date
    09-17-2009
    Location
    Galati, Romania
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: Getting value of specific Listbox Item

    thaks Trebor, works like a charm.

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Getting value of specific Listbox Item

    You're welcome. If you could mark the thread as solved it would be appreciated.

+ 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 Array creates blank ListBox item
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-16-2019, 12:33 PM
  2. [SOLVED] if anything in listbox select first item, if listbox empty do nothing (listbox in userform
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2015, 12:49 PM
  3. [SOLVED] Select Specific Item in ListBox
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 08-15-2014, 07:15 AM
  4. [SOLVED] listbox item selection to got to specific sheet
    By sumonrezadu in forum Excel General
    Replies: 14
    Last Post: 05-17-2013, 12:38 AM
  5. [SOLVED] If Userform ListBox contains specific item then change label background colour.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-06-2012, 06:38 AM
  6. [SOLVED] Copy one listbox item to same index position in another listbox
    By Foreverlearning in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-19-2012, 06:05 AM
  7. Populate ListBox Based On Item Chosen In Another ListBox
    By davemojo82 in forum Excel General
    Replies: 1
    Last Post: 08-04-2009, 08:39 AM

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