J
jacobk
Hi,
I have made a form in VBA with 2 listboxes, lstSubrubriek and lstResult with
3 columns.
The selections the user made in lstSubrubriek I want to display in lstResult.
I've done this in a listbox, because the user can order the list in lstResult.
Rather I get the run-time error 380 'Invalid property array index'.
Can anyone help??
See sub below:
Private Sub lstSubrubriek_Change()
Dim intRows As Integer
Dim varItem As Variant
Set lst = lstSubrubriek
intRows = lst.ListCount - 1
LstResult.Clear
For varItem = 0 To intRows
If lst.Selected(varItem) = True Then
With LstResult
.Column(0, varItem) = Nz(lst.Column(0, varItem))
' ** Gives Run-time error 380 Invalid property array index **
End With
End If
Next
End Sub
Thanks a lot!!
JacobK.
I have made a form in VBA with 2 listboxes, lstSubrubriek and lstResult with
3 columns.
The selections the user made in lstSubrubriek I want to display in lstResult.
I've done this in a listbox, because the user can order the list in lstResult.
Rather I get the run-time error 380 'Invalid property array index'.
Can anyone help??
See sub below:
Private Sub lstSubrubriek_Change()
Dim intRows As Integer
Dim varItem As Variant
Set lst = lstSubrubriek
intRows = lst.ListCount - 1
LstResult.Clear
For varItem = 0 To intRows
If lst.Selected(varItem) = True Then
With LstResult
.Column(0, varItem) = Nz(lst.Column(0, varItem))
' ** Gives Run-time error 380 Invalid property array index **
End With
End If
Next
End Sub
Thanks a lot!!
JacobK.