Dim varItm As Variant
Hi,
Not had much experience of arrays, but am trying to capture the data selected in a multi-select list in a number of array variables.
However the following piece of code is giving me a 'subscript out of range' error
Any help much appreciated - Dan
--CODE--
Dim i As Integer
Dim strArray() As String
i = 1
For Each varItm In Me.lstMonth.ItemsSelected
MsgBox Me.lstMonth.ItemData(varItm)
strArray(i) = Me.lstMonth.ItemData(varItm)
i = i + 1
Next varItm
Hi,
Not had much experience of arrays, but am trying to capture the data selected in a multi-select list in a number of array variables.
However the following piece of code is giving me a 'subscript out of range' error
Any help much appreciated - Dan
--CODE--
Dim i As Integer
Dim strArray() As String
i = 1
For Each varItm In Me.lstMonth.ItemsSelected
MsgBox Me.lstMonth.ItemData(varItm)
strArray(i) = Me.lstMonth.ItemData(varItm)
i = i + 1
Next varItm