Brewdog, seems like it would be loads more efficient to simply dimension based on the list size, before the loop. Rather than using the Redim Preserve.
Dim strArray() As String
Dim i As Integer
ReDim strArray(lstNames.ListCoun
For i = 0 To lstNames.ListCount - 1
strArray(i) = lstNames.ItemData(i)
Next i
Main Topics
Browse All Topics





by: brewdogPosted on 1999-10-06 at 14:29:04ID: 2104806
I'm not sure what you want to do with them after you get them, so here's the snippet:
Dim strArray() As String
Dim i As Integer
For i = 0 To lstNames.ListCount - 1
ReDim Preserve strArray(i)
strArray(i) = lstNames.ItemData(i)
Next i
lstNames here is the name of your list box. Hope that helps . . .
brewdog