Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


--
davey
------------------------------------------------------------------------
davey's Profile: http://www.excelforum.com/member.php...o&userid=24340
View this thread: http://www.excelforum.com/showthread...hreadid=379411

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Extracting choice from a ListBox

Listbox1.Value just the same.

--
HTH

Bob Phillips

"davey" wrote in
message ...

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extracting choice from a ListBox


Hi again,

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

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

This is great!

- Dave

--
dave
-----------------------------------------------------------------------
davey's Profile: http://www.excelforum.com/member.php...fo&userid=2434
View this thread: http://www.excelforum.com/showthread.php?threadid=37941

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extracting choice from a ListBox


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

- Dave

--
dave
-----------------------------------------------------------------------
davey's Profile: http://www.excelforum.com/member.php...fo&userid=2434
View this thread: http://www.excelforum.com/showthread.php?threadid=37941

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
listbox B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 08:27 PM
Hiding rows based on choice in a listbox robhargreaves Excel Discussion (Misc queries) 1 July 24th 05 12:58 PM
Multicolumn Listbox and ordinary listbox Ron_D Excel Programming 0 June 4th 04 08:56 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM


All times are GMT +1. The time now is 12:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"