Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting multiple items on Listbox


Hi,

I am new to MS Excel and need help with the selection of multiple items
on a Listbox (using the Control Toolbox). I have managed to set up a
listbox and it allows me to select more than one item (using
Multiselect in Properties).

I want to output my selections to cells in my worksheet. So if I
select two items from my listbox I will have the values for those items
in Cells: A1 and A2. Essentially I would like a Linkedcell
functionality for multiple selections and not just single selections.

Can anyone help with this.

Thanks

Rahul


--
Rahul_Uk
------------------------------------------------------------------------
Rahul_Uk's Profile: http://www.excelforum.com/member.php...o&userid=33690
View this thread: http://www.excelforum.com/showthread...hreadid=534632

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Selecting multiple items on Listbox

Private Sub ListBox1_Change()
Dim i As Long
Dim j As Long
With Me.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
j = j + 1
Cells(j, "A").Value = .List(i)
End If
Next i
End With
End Sub

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Rahul_Uk" wrote in
message ...

Hi,

I am new to MS Excel and need help with the selection of multiple items
on a Listbox (using the Control Toolbox). I have managed to set up a
listbox and it allows me to select more than one item (using
Multiselect in Properties).

I want to output my selections to cells in my worksheet. So if I
select two items from my listbox I will have the values for those items
in Cells: A1 and A2. Essentially I would like a Linkedcell
functionality for multiple selections and not just single selections.

Can anyone help with this.

Thanks

Rahul


--
Rahul_Uk
------------------------------------------------------------------------
Rahul_Uk's Profile:

http://www.excelforum.com/member.php...o&userid=33690
View this thread: http://www.excelforum.com/showthread...hreadid=534632



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting multiple items on Listbox


Thanks for the quick response...your help is much appreciated.

I still have the following problems unfortunately.

1. The code worked initially populating Cell A1 with my selection. But
it does not work anymore.

2. When it did work it only managed to populate cell A1 with the first
item selected but did not populate A2 or A3 with the second and third
items selected from the Listbox.


--
Rahul_Uk
------------------------------------------------------------------------
Rahul_Uk's Profile: http://www.excelforum.com/member.php...o&userid=33690
View this thread: http://www.excelforum.com/showthread...hreadid=534632

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
Select multiple items in a listbox uecem[_4_] Excel Programming 2 November 26th 04 02:00 AM
1. Selecting multiple items from drop listbox kurb Excel Programming 0 October 16th 04 09:01 PM
Selecting Multiple items in ListBox Dave Peterson[_3_] Excel Programming 0 August 26th 04 01:33 AM
Selecting multiple items and columns from ListBox TK Excel Programming 0 August 25th 04 01:19 AM
Selecting multiple rows from listbox for reporting Brett9[_2_] Excel Programming 3 November 5th 03 11:07 AM


All times are GMT +1. The time now is 06:39 AM.

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

About Us

"It's about Microsoft Excel"