ListBox & Array
I've run into an issue that I am having a difficult time figuring out so any help will be appreciated.
Here's the story: I have two ListBoxes (lstMGR and lstTeam). I am trying to create a way that multiple teams can be assigned to a MGR by selecting the MGR and then selecting their assigned teams from the respective ListBoxes. I thought using an array would be a good way to store the team numbers (since each MGR can have up to 20 assigned to them) and used this code ...
Dim intRow As Integer
Dim strTeamNumber(0 To 99) As String
With Forms("frmLeadership").lstTeam
For intRow = 0 To .ListCount
If .Selected(intRow) = True Then
strTeamNumber(intRow) = .Column(0)
Debug.Print strTeamNumber(intRow)
End If
Next intRow
End With
This appears to work fine with one exception. If I choose team 001, 003, 005, and 007 for a MGR the array is loaded with the data from the last selected line in lstTeam (ie 005, 005, 005, 005 is the result).
My question is how do I get each selected row of data loaded into a separate array element?
Kenny Alligood
__________________
Kenny Alligood
|