+ Reply to Thread
Results 1 to 5 of 5

Extracting choice from a ListBox

  1. #1
    Registered User
    Join Date
    06-15-2005
    Posts
    7

    Extracting choice from a ListBox

    This is my first post.

    When using a ListBox with the "Option" style (as opposed to "Plain"), how do you write the code to test for which item was selected, so that it can be used in another part of the subroutine or module?

    Thanks!

    - Dave

  2. #2
    Registered User
    Join Date
    06-15-2005
    Posts
    7

    Found it by doing a Forum Search

    Hi again,

    I didn't see the Forum Search button before submitting the original post about extracting data from a listbox.

    I found it, then did a search, and found a post by Harald Staff on 6-08-05 that gave me the help I needed, in a thread called "Choosing Items in a Listbox".

    This is great!

    - Davey

  3. #3
    Bob Phillips
    Guest

    Re: Extracting choice from a ListBox

    Listbox1.Value just the same.

    --
    HTH

    Bob Phillips

    "davey" <davey.1qogif_1118855154.4407@excelforum-nospam.com> wrote in
    message news:davey.1qogif_1118855154.4407@excelforum-nospam.com...
    >
    > This is my first post.
    >
    > When using a ListBox with the "Option" style (as opposed to "Plain"),
    > how do you write the code to test for which item was selected, so that
    > it can be used in another part of the subroutine or module?
    >
    > Thanks!
    >
    > - Dave
    >
    >
    > --
    > davey
    > ------------------------------------------------------------------------
    > davey's Profile:

    http://www.excelforum.com/member.php...o&userid=24340
    > View this thread: http://www.excelforum.com/showthread...hreadid=379411
    >




  4. #4
    Toppers
    Guest

    RE: Extracting choice from a ListBox

    Hi,
    Add code similar to this to your userform:

    Private Sub ListBox1_Click()
    Worksheets("Sheet1").Range("a1")=ListBox1.value ' Assign data to cell
    a1 in Sheet1
    End Sub


    HTH

    "davey" wrote:

    >
    > This is my first post.
    >
    > When using a ListBox with the "Option" style (as opposed to "Plain"),
    > how do you write the code to test for which item was selected, so that
    > it can be used in another part of the subroutine or module?
    >
    > Thanks!
    >
    > - Dave
    >
    >
    > --
    > davey
    > ------------------------------------------------------------------------
    > davey's Profile: http://www.excelforum.com/member.php...o&userid=24340
    > View this thread: http://www.excelforum.com/showthread...hreadid=379411
    >
    >


  5. #5
    Registered User
    Join Date
    06-15-2005
    Posts
    7

    Thanks

    Thank You Bob & Toppers! Those are very helpful, and seem even easier.

    - Davey

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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