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

I have a userform I created that contains a multiselect listbox that gets
data from a worksheet "Personnel".

When I select the items I want in the listbox, it then is suppose to populate
a range of cells on another worksheet "Incident Report"

I am able to populate the listbox, select multiple items, and I have it so it
sends data to the worksheet across multiple columns... the only problem is
that it is sending the complete list and NOT the selected items. Can someone
please point me in the right direction? Thanks.


'---------------------------------------------------------------
Private Sub cmdAdd_Click()
Dim lPart As Long
Dim lItem As Long
Dim CellX As Long
Dim I As Long
Dim RangeRow As String
Dim ws As Worksheet
Set ws = Worksheets("Incident Report")

lPart = Me.cboTeam1.ListIndex
CellX = 27
I = 0
RangeRow = "A"
With Me.cboTeam1
For lItem = 0 To cboTeam1.ListCount - 1
If cboTeam1.Selected(lPart) = True Then
CellX = CellX + 1
I = I + 1
If CellX = 37 Then
CellX = 28
If I 9 Then RangeRow = "F"
If I 18 Then RangeRow = "K"
If I 27 Then End
End If
Range(RangeRow & CellX).Value = cboTeam1.List(lItem, 1)
End If
Next lItem
End With


'clear the data
Me.cboTeam1.Value = ""
Me.cboTeam1.SetFocus

End Sub

'-----------------------------------------------------------------------------
---

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
MultiSelect ListBox Help VBA_Newbie79[_2_] Excel Programming 2 June 29th 07 07:28 PM
How do I use a multiselect listbox Neil Murphy Excel Programming 2 November 17th 06 10:00 AM
Multiselect Listbox use RKS Excel Discussion (Misc queries) 1 May 12th 06 03:04 PM
Multiselect Listbox Francis Ang[_3_] Excel Programming 2 October 25th 04 01:57 AM
multiselect listbox CG Rosén Excel Programming 2 December 28th 03 05:17 PM


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