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
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
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
Listbox1.Value just the same.
--
HTH
Bob Phillips
"davey" <[email protected]> wrote in
message news:[email protected]...
>
> 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
>
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
>
>
Thank You Bob & Toppers! Those are very helpful, and seem even easier.
- Davey
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks