Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default getting selected listbox values



i set multiselect property of listbox control to fmMultiSelectExtended.
by the way, i want to get the selected list names.
the following code...??

for i = 0 to listbox1.listcount - 1
if listbox1.list(listbox1.listindex).selected then
msgbox listbox1.list(listbox1.listindex)
endif
next

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default getting selected listbox values

Hi X Taol,

Try:

'=============
Private Sub CommandButton1_Click()
Dim i As Long

For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
MsgBox ListBox1.List(i)
End If
Next i

End Sub
'<<=============

---
Regards,
Norman



"x taol" wrote in message
...


i set multiselect property of listbox control to fmMultiSelectExtended.
by the way, i want to get the selected list names.
the following code...??

for i = 0 to listbox1.listcount - 1
if listbox1.list(listbox1.listindex).selected then
msgbox listbox1.list(listbox1.listindex)
endif
next

*** Sent via Developersdex http://www.developersdex.com ***



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
How to set the selected state of an embedded ActiveX listbox [email protected] Excel Discussion (Misc queries) 1 February 5th 07 09:30 PM
How to add selected row into listbox? frankosun Excel Programming 1 December 17th 05 10:01 PM
ListBox Selected Items into an Array jtp550 Excel Programming 3 September 28th 05 12:44 AM
Fill values into a listbox matching selected values from a combobox Jon[_19_] Excel Programming 4 January 25th 05 04:25 PM
Transposing a rng selected from a listbox JoeH[_7_] Excel Programming 4 September 12th 04 03:26 AM


All times are GMT +1. The time now is 05:52 AM.

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"