Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Multi Selection in a ListBox

I have written an app in excel version 2002 with SP-1
installed. It contains a userform with a listbox.
The "MultiSelect" property is set to
1-fmMultiSelectMulti. This works fine with this version
and higher. But when I run the app on version 2000, the
selected items do not return a value of "True". However
if I reset the property to 0-fmMultiSelectSingle it works
fine.

How can I overcome this problem?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Multi Selection in a ListBox

this control has supported the fmMultiSelectMulti since it (MSForms
controls) was introduced in xl97. There should be no problem with using it.
Perhaps if you show the code that you say doesn't work in xl2000.

--
Regards,
Tom Ogilvy

"Claus Mygind" wrote in message
...
I have written an app in excel version 2002 with SP-1
installed. It contains a userform with a listbox.
The "MultiSelect" property is set to
1-fmMultiSelectMulti. This works fine with this version
and higher. But when I run the app on version 2000, the
selected items do not return a value of "True". However
if I reset the property to 0-fmMultiSelectSingle it works
fine.

How can I overcome this problem?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Multi Selection in a ListBox

You have to check all items like so

Dim i As Long
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
Debug.Print ListBox1.List(i)
End If
Next i


--
HTH

Bob Phillips

"Claus Mygind" wrote in message
...
I have written an app in excel version 2002 with SP-1
installed. It contains a userform with a listbox.
The "MultiSelect" property is set to
1-fmMultiSelectMulti. This works fine with this version
and higher. But when I run the app on version 2000, the
selected items do not return a value of "True". However
if I reset the property to 0-fmMultiSelectSingle it works
fine.

How can I overcome this problem?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Multi Selection in a ListBox

Bob,
Thanks. As you can see by my code I was doing that.

My Code:
For i = 0 To cLastRow
If myListBox.Selected(i) = True Then

However all values whether selected or not returned a "False" value. I
recoded the data source for the listBox and that seemed to solve the
problem.

From This:
' UserForm1.ListBox1.RowSource = cPickList

To This:
wkLastRow = Mid(cPickTable, InStr(1, cPickTable, "H$", 1) + 2)
Range("AD4").Select
While wkLastRow = ActiveCell.Row

UserForm1.ListBox1.AddItem (ActiveCell.Value)
Application.Goto REFERENCE:="R[1]C"

Wend



"Bob Phillips" wrote in message
...
You have to check all items like so

Dim i As Long
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
Debug.Print ListBox1.List(i)
End If
Next i


--
HTH

Bob Phillips

"Claus Mygind" wrote in message
...
I have written an app in excel version 2002 with SP-1
installed. It contains a userform with a listbox.
The "MultiSelect" property is set to
1-fmMultiSelectMulti. This works fine with this version
and higher. But when I run the app on version 2000, the
selected items do not return a value of "True". However
if I reset the property to 0-fmMultiSelectSingle it works
fine.

How can I overcome this problem?






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
Multi-select listbox help! John[_60_] Excel Programming 3 October 9th 04 01:57 AM
Listbox multi selection Jorge Rodrigues Excel Programming 3 September 7th 04 11:06 PM
multi select listbox Paul Mueller Excel Programming 2 June 10th 04 09:08 PM
populating a multi-column Listbox Tom Ogilvy Excel Programming 3 April 26th 04 08:26 PM
Multi-columns in a ListBox Tom Atkisson Excel Programming 1 October 5th 03 10:27 PM


All times are GMT +1. The time now is 10:44 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"